Repository navigation
fix(sbom): strip --!> when reading a copyright holder - #1330
Merged
Merged
Conversation
CodeQL flagged _COMMENT_MARKUP (py/bad-tag-filter, alert #52) for accepting only `-->` as an HTML comment end. The regex is not a sanitizer; it trims comment delimiters from a copyright line so the holder name comes out clean. HTML also ends a comment at `--!>`, and a notice closed that way produced the holder "Bar Ltd --!>". Accept `--!?>` and cover it in the comment-markup test. Signed-off-by: Andrei Aristarkhov <aaristarkhov@nvidia.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
jiwenc-nv
approved these changes
Oct 24, 2026
This branch was successfully deployed
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.
Resolves code-scanning alert #52 (CodeQL
py/bad-tag-filter)._COMMENT_MARKUPinscripts/sbom/isaaccapture_sbom/discovery.pydoes not sanitize HTML. It trims comment delimiters from a scraped copyright line so the holder name comes out clean, so the alert's XSS framing doesn't apply. Its point about correctness still holds: HTML also ends a comment at--!>, and a notice closed that way gave the holderBar Ltd --!>.--!?>as a comment end.html-bang-endcase totest_comment_markup_is_not_part_of_a_scraped_holder.Testing
uv run --project scripts/sbom --extra dev pytest scripts/sbom/tests -k comment_markup: all three cases pass.SKIP=check-copyright-year pre-commit run --all-filespasses.🤖 Generated with Claude Code
Summary by CodeRabbit
--!>, as well as standard-->comments.