Skip to content

fix: exempt display-only session metadata from SEC-005 - #71286

Merged
pelikhan merged 1 commit into
mainfrom
pelikhan-issue-71058-exempt-display-metadata-from-sec-005-928ae2
Oct 23, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pelikhan-issue-71058-exempt-display-metadata-from-sec-005-928ae2

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Summary

Fixes #71058.

  • Document SEC-005 exemptions beside the targetRepo metadata projection and human-readable session rendering. Neither module performs cross-repository API writes; both comments require removing the exemption and adding allowlist validation if that changes.
  • Extend the existing checker regression with copies of the actual metadata modules and negative controls that remove their exemption annotations.
  • Keep an unsafe cross-repository API-write fixture flagged, without changing the conformance checker or weakening write-handler checks.

Validation

  • PATH="/opt/homebrew/bin:$PATH" bash scripts/check-safe-outputs-conformance_test.sh
  • make fmt-cjs && make lint-cjs
  • cd actions/setup/js && npm run test:js -- unified_session_payload.test.cjs unified_session_render.test.cjs repo_helpers.test.cjs — 332 tests passed.
  • PATH="/opt/homebrew/bin:$PATH" make agent-report-progress

This corrects a checker false positive; it does not remediate an exploitable cross-repository write path.

Document why targetRepo projection and rendering do not require cross-repository write authorization. Cover the real modules, stripped-annotation controls, and an unsafe API-write fixture in checker regression tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI max review requested due to automatic review settings October 23, 2026 00:40
@pelikhan
pelikhan marked this pull request as draft October 23, 2026 00:40

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

The exemptions match metadata-only usage, regression coverage preserves enforcement, and no blocking issues remain.

No open issues 🎉

What changed in this PR

Addresses #71058 by exempting display-only session metadata from SEC-005 without changing the conformance checker or weakening cross-repository write checks.

Changes:

  • Adds documented exemptions beside metadata projection and rendering, with guidance for future write behavior.
  • Extends regression coverage with real-module fixtures, annotation-removal controls, and an unsafe API-write fixture.
File Description
scripts/​check-safe-outputs-conformance_test.sh Verifies exemptions while preserving detection of unvalidated handlers.
actions/​setup/​js/​unified_session_render.cjs Documents the exemption for display-only metadata.
actions/​setup/​js/​unified_session_payload.cjs Documents the exemption for metadata projection.

Review effort: Max

@pelikhan
pelikhan marked this pull request as ready for review October 23, 2026 00:49
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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 🏗️ · opus55 · ~11 AIC · ⌖ ~37 AIC · ◇ ~16 AIC · ⊞ 1.9K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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 · gpt56 · ~6 AIC · ⌖ ~6 AIC · ⊞ 14.8K · ◷

Generated by Ponytail Reviewer for #71286

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🧠 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 Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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 · sonnet50 · ~13 AIC · ⌖ ~16 AIC · ◇ ~5 AIC · ⊞ 12.7K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-23T00:52:35Z
review_event: COMMENT
top_themes:
  - file-wide SEC-005 exemptions can hide future cross-repository writes
  - exemption regression tests do not enforce exemption scope
files_reviewed:
  - actions/setup/js/unified_session_payload.cjs
  - actions/setup/js/unified_session_render.cjs
  - scripts/check-safe-outputs-conformance_test.sh
comment_count: 2

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷
Comment /review to run again

@github-actions github-actions Bot 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.

Review

Two non-blocking maintainability/security-hardening concerns: SEC-005 exemptions are file-wide, so future write paths added to either display module would bypass the checker unless the comments stay accurate. The current tests verify marker removal but do not enforce exemption scope.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

ref: ["ref"],
sha: ["sha"],
actor: ["actor"],
// @safe-outputs-exempt SEC-005: display/telemetry-only metadata, not a cross-repo API write target.

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.

This file-wide exemption disables SEC-005 for any future cross-repository write added anywhere in this module, so the checker would silently accept an unsafe path.

💡 Scope the exemption to display-only behavior

The conformance checker skips the entire file when it finds @safe-outputs-exempt SEC-005; it does not associate the marker with only this field mapping. The nearby reminder is human-only and cannot prevent a later write from bypassing validation. Either scope exemptions to the specific projection or add a regression fixture showing that an exempted file containing a write is still rejected.

"ref",
"sha",
"actor",
// @safe-outputs-exempt SEC-005: display-only session metadata; this module makes no cross-repo API writes.

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.

This file-wide exemption disables SEC-005 for any future cross-repository write added anywhere in this renderer, leaving the safety guarantee dependent on a comment remaining accurate.

💡 Make the exemption enforceable

The checker skips the whole file as soon as it sees the SEC-005 marker; it cannot distinguish this display-only field list from a later API-writing code path. Scope the exemption to the projection or add a negative test proving that an exempted module with a write call is rejected, rather than relying only on the removal-of-marker fixture.

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — no actionable issues found.

📋 Analysis

This is a narrowly-scoped checker false-positive fix. Verified independently (not just trusting the PR description) that neither unified_session_payload.cjs nor unified_session_render.cjs contains any octokit/API-write calls anywhere in the file — targetRepo is only ever used for field selection and string rendering, confirming the @safe-outputs-exempt SEC-005 annotations are accurate rather than just asserted.

Positive highlights

  • ✅ Each exemption comment documents why it's safe and when to remove it (/diagnosing-bugs: root cause of the false positive is addressed at the source, not papered over).
  • ✅ The test extension follows a solid regression pattern per /tdd: it copies the real modules, strips the exemption annotation via sed, and asserts the checker does flag the stripped copy as HIGH while passing on the exempted original — a genuine negative control rather than a tautological check.
  • ✅ scripts/check-safe-outputs-conformance_test.sh ran clean locally (PASS: SEC-005 enforces cross-repository authorization...).

No blocking concerns. Minor non-blocking note for the author's awareness: the sed regex negative-control pattern matches the annotation text literally — if the comment wording is reworded without matching SEC-005, the _unexempted fixture would silently fail to diverge from the original. Not worth a change given existing assertions already catch a mismatch (test would just fail differently); just flagging the coupling for future maintainers.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · ~57 AIC · ⌖ ~15 AIC · ⊞ 10.2K
Comment /matt to run again

@pelikhan
pelikhan merged commit 8a83748 into main Oct 23, 2026
142 checks passed
@pelikhan
pelikhan deleted the pelikhan-issue-71058-exempt-display-metadata-from-sec-005-928ae2 branch October 23, 2026 01:26
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.93.2

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: Cross-repo target-repo field flagged without allowlist check

2 participants