Skip to content

Conversation

@aka76bm
Copy link
Owner

@aka76bm aka76bm commented Oct 23, 2025

Potential fix for https://github.com/aka76bm/node/security/code-scanning/134

The best way to fix this issue is to ensure that all HTML comment blocks are completely removed—even if new comment boundaries are exposed after partial replacements. This is safely achieved by repeatedly applying the regex replacement until no further changes occur. In the context of the code, update line 381 to use a loop: continue replacing <!--.*?--> with an empty string until the string stabilizes and no instances remain. This fix preserves all existing functionality, only strengthening sanitization, and should be applied at the point where .replace(/<!--.*?-->/sg, '') is currently used. No new imports or library dependencies are required.


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

…cter sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@aka76bm aka76bm marked this pull request as ready for review October 23, 2025 06:51
@aka76bm aka76bm merged commit 76d8008 into main Oct 23, 2025
26 of 38 checks passed
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