Skip to content

Conversation

@Mira190
Copy link
Contributor

@Mira190 Mira190 commented Oct 10, 2025

Potential fix for https://github.com/InvolutionHell/involutionhell.github.io/security/code-scanning/3

To fix this problem, we need to ensure all HTML/MDX tags are thoroughly removed, including cases where consecutive characters produce nested or re-emerging unsafe constructs after initial replacement (such as <script> and similar patterns). The ideal approach is to repeatedly apply the tag-removal regular expression until no more tags are detected, so that constructs like <<script>> are reduced to an empty string or harmless content.

Specifically, in the extractTextFromMDX function in app/docs/[...slug]/page.tsx, we should change the .replace(/<[^>]+>/g, "") on line 24 to a loop that repeatedly applies it until no more changes occur. No new libraries are required if we use this approach.

Required changes:

  • On line 24, replace the single .replace() call for HTML/MDX tags with a loop that continues replacing as long as matches are found.
  • This may require extracting that step out of the chain for clarity, or using a helper function within extractTextFromMDX.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…er sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@vercel
Copy link

vercel bot commented Oct 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
involutionhell-github-io Ready Ready Preview Comment Oct 10, 2025 4:01am
website-preview Ready Ready Preview Comment Oct 10, 2025 4:01am

@Mira190 Mira190 marked this pull request as ready for review October 10, 2025 04:05
@Mira190 Mira190 merged commit 8c7fd5b into main Oct 10, 2025
8 checks passed
@Mira190 Mira190 deleted the alert-autofix-3 branch October 11, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants