Skip to content

fix(SEC-005): tighten cross-repo regex to eliminate false positive on frontmatter_hash_pure.cjs - #46568

Merged
pelikhan merged 3 commits into
mainfrom
copilot/sec-005-fix-conformance-checker-false-positive
Jul 19, 2026
Merged

fix(SEC-005): tighten cross-repo regex to eliminate false positive on frontmatter_hash_pure.cjs#46568
pelikhan merged 3 commits into
mainfrom
copilot/sec-005-fix-conformance-checker-false-positive

Conversation

Copilot AI commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

SEC-005 conformance checker falsely flagged frontmatter_hash_pure.cjs because the loose pattern target.*[Rr]epo matched target and repo as unrelated tokens on the same line — a symlink resolution call, not a cross-repo config surface.

Changes

  • scripts/check-safe-outputs-conformance.sh: Replace the loose target.*[Rr]epo\|targetRepo pattern with explicit config-surface identifiers anchored by word boundaries:
- if grep -q "target.*[Rr]epo\|targetRepo" "$handler"; then
+ if grep -qE "\btarget-repo\b|\btargetRepo\b|\btarget_repo\b" "$handler"; then

The new pattern matches only the three canonical forms of the config parameter (kebab, camelCase, snake_case) and uses \b to prevent substring hits inside longer identifiers. Genuine cross-repo handlers (e.g. apply_samples.cjs, close_pull_request.cjs) all use one of these explicit forms and continue to be detected.

Copilot AI and others added 2 commits July 19, 2026 07:32
…ntmatter_hash_pure.cjs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix false-positive in SEC-005 conformance checker fix(SEC-005): tighten cross-repo regex to eliminate false positive on frontmatter_hash_pure.cjs Jul 19, 2026
Copilot AI requested a review from pelikhan July 19, 2026 07:34
@pelikhan
pelikhan marked this pull request as ready for review July 19, 2026 07:35
Copilot AI review requested due to automatic review settings July 19, 2026 07:35
@pelikhan
pelikhan merged commit 2482b64 into main Jul 19, 2026
@pelikhan
pelikhan deleted the copilot/sec-005-fix-conformance-checker-false-positive branch July 19, 2026 07:35

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.

Pull request overview

Narrows SEC-005 matching to avoid unrelated target/repo false positives.

Changes:

  • Matches canonical target-repository identifiers with word boundaries.
  • One issue remains: handlers using resolveTargetRepoConfig are skipped.
Show a summary per file
File Description
scripts/check-safe-outputs-conformance.sh Refines SEC-005 cross-repository detection.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment on lines +180 to +181
# Check if handler supports target-repo (match explicit config-surface identifiers only)
if grep -qE "\btarget-repo\b|\btargetRepo\b|\btarget_repo\b" "$handler"; then
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.14

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.

[Safe Outputs Conformance] SEC-005: Conformance checker false-positive on frontmatter_hash_pure.cjs (cross-repo allowlist)

3 participants