Skip to content

[code-scanning-fix] Fix js/incomplete-multi-character-sanitization: use repeated HTML comment stripping - #75350

Merged
pelikhan merged 1 commit into
mainfrom
code-scanning-fix-1067-963aefaac6c855f0
Nov 6, 2026
Merged

pelikhan merged 1 commit into
mainfrom
code-scanning-fix-1067-963aefaac6c855f0

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Security Fix: Incomplete multi-character sanitization

Alert Number: #1067
Severity: High
Rule: js/incomplete-multi-character-sanitization
CWE: CWE-116

Vulnerability Description

A single-pass replace(/<!--[\s\S]*?--!?>/g, "") can leave a <!-- sequence behind (e.g. nested/overlapping markers).

Location

  • File: scripts/pr-sous-chef.test.mjs
  • Line: 161

Fix Applied

Changes Made:

  • Replaced the single-pass regex with the existing stripHtmlComments helper, which repeats removal until stable and strips any residual <!--.

Security Best Practices

  • Iterate sanitization to a fixed point; remove dangling openers.

Testing Considerations

  • Run node --test scripts/pr-sous-chef.test.mjs.

Automated by: Code Scanning Fixer Workflow
Run ID: 42177378444

Generated by 🔒 Code Scanning Fixer · copilot · routed: opus55 low · ~33 AIC · ⌖ ~2 AIC · ⊞ 4.3K · ◷

  • expires on Nov 7, 2026, 11:01 PM UTC-08:00

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the test-only change that reuses the existing HTML-comment stripping helper.

No open issues 🎉

What changed in this PR

Addresses the flagged incomplete-sanitization pattern in the PR sous-chef tests by reusing the existing HTML-comment stripping helper. Production code is unchanged.

Changes:

  • Replaces single-pass comment removal with stripHtmlComments, which repeats removal until stable and removes dangling openers.
File Description
scripts/​pr-sous-chef.test.mjs Uses the existing helper when checking assignment-request content.

Review effort: Max (auto)

@pelikhan
pelikhan marked this pull request as ready for review November 6, 2026 08:05
@pelikhan
pelikhan merged commit cac21d8 into main Nov 6, 2026
11 checks passed
@pelikhan
pelikhan deleted the code-scanning-fix-1067-963aefaac6c855f0 branch November 6, 2026 08:05
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · routed: gpt56 max · ~2 AIC · ⌖ ~1 AIC · ⊞ 118 · ◷

Generated by Ponytail Reviewer for #75350

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from PR Specification Reviewer · gpt56 · ~1 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #75350

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: gpt56 max · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: gpt56 max · ~2 AIC · ⌖ ~1 AIC · ⊞ 6.3K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v1.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants