Fix incomplete multi-character sanitization in source files (pkg/workflow/js)#7581
Merged
pelikhan merged 2 commits intomain-b6f614096c32b91ffrom Dec 25, 2025
Merged
Fix incomplete multi-character sanitization in source files (pkg/workflow/js)#7581pelikhan merged 2 commits intomain-b6f614096c32b91ffrom
pelikhan merged 2 commits intomain-b6f614096c32b91ffrom
Conversation
Applied the incomplete multi-character sanitization fix to the source files: - pkg/workflow/js/sanitize_content_core.cjs: removeXmlComments() - pkg/workflow/js/runtime_import.cjs: removeXMLComments() Both functions now use iterative replacement to handle nested/overlapping HTML comment patterns that could reintroduce comment markers after a single pass. Ran make recompile to update all compiled workflow lock files. All JavaScript tests pass (2238 passed, 5 skipped). Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix incomplete multi-character sanitization in HTML comment removal
Fix incomplete multi-character sanitization in source files (pkg/workflow/js)
Dec 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The security fix for CodeQL alerts #85, #86, #87 was applied to compiled files in
actions/setup/js/instead of source files inpkg/workflow/js/. This meant the vulnerability would reappear on next compilation.Changes
Applied iterative sanitization to source files:
pkg/workflow/js/sanitize_content_core.cjs-removeXmlComments()pkg/workflow/js/runtime_import.cjs-removeXMLComments()Recompiled all workflow lock files (124 files) to propagate the fix
Implementation
Both functions now use do-while loops to repeatedly apply replacements until no more HTML comment patterns exist:
This prevents bypass via nested patterns like
<!--<!--comment-->-->which would leave<!---->after a single pass.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.