Skip to content

fix: authorize resolved issue relationship repositories - #73882

Merged
pelikhan merged 3 commits into
mainfrom
pelikhan/resolved-repository-authorization
Nov 2, 2026
Merged

pelikhan merged 3 commits into
mainfrom
pelikhan/resolved-repository-authorization

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes CWE-863 code scanning alerts 1055 and 1056. Agent-controlled temporary IDs and cross-repository blocker references could reach repositories outside the configured policy using the privileged safe-output client.

  • Validate the effective link_sub_issue repository after temporary-ID resolution and parent target selection, before issue reads or linking.
  • Validate every resolved create_issue.blocked_by repository before per-item API work or issue creation using the existing target-repo and allowed-repos policy.
  • Preserve permitted numeric, qualified, URL, and temporary references, wildcard repository policies, and fixed/triggering parent semantics. Disallowed blockers reject the request before creating an issue; dependency API failures after creation retain existing best-effort behavior.
  • Document the repository boundary and add regressions for denied targets with zero API calls, deferred retries, staged mode, and permitted configurations.

Validation

  • Focused suites: 158 tests passed.
  • make fmt-cjs and make lint-cjs passed.
  • make agent-report-progress passed, including build and impacted JavaScript tests; no changed Go files required Go tests.
  • One pre-existing finite-date lint warning remains at create_issue.cjs:304; no lint errors.

Alerts have not been dismissed.

Validate resolved sub-issue repositories and blocked-by references before privileged API access. Cover allowed policies, temporary IDs, deferred retries, and target semantics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review November 1, 2026 19:21
Copilot AI dynamic review requested due to automatic review settings November 1, 2026 19:21
@github-actions

github-actions Bot commented Nov 1, 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 Nov 1, 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 🏗️ · routed: opus55 medium · ~12 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 1, 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 · ~16 AIC · ⌖ ~16 AIC · ◇ ~8 AIC · ⊞ 12.7K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 1, 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 Nov 1, 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 · ~12 AIC · ⌖ ~6 AIC · ⊞ 15.1K · ◷

Generated by Ponytail Reviewer for #73882

@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 result

No actionable issues found in the changed lines. Repository validation is performed after temporary-ID and target resolution and before the relevant API calls; the added tests cover deferred, staged, wildcard, and cross-repository cases.

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

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.

🟡 Changes recommended

The repository-policy wording needs clarification in two places because validation accepts a match in either target-repo or allowed-repos, rather than requiring both.

1 open issue
What changed in this PR

This PR closes repository-authorization gaps in gh-aw’s safe-output issue relationship handlers, preventing resolved references from accessing repositories outside the configured policy.

Changes:

  • Validate the effective sub-issue repository after temporary-ID resolution and parent selection.
  • Validate resolved blockers before per-item API calls or issue creation, while preserving permitted references and deferred behavior.
  • Document the repository boundary and add regression tests for denied and permitted configurations.
File Description
docs/​src/​content/​docs/​reference/​safe-outputs.md Documents repository restrictions for blockers and sub-issue links.
actions/​setup/​js/​link_sub_issue.test.cjs Tests denied targets, deferred resolution, permitted policies, and parent selection.
actions/​setup/​js/​link_sub_issue.cjs Authorizes the effective repository before issue reads or linking.
actions/​setup/​js/​create_issue.test.cjs Tests blocker authorization, retries, staged mode, and permitted references.
actions/​setup/​js/​create_issue.cjs Authorizes resolved blockers before mention resolution and issue creation.

Review effort: Max (auto)

@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 /tdd and /codebase-design. The core fix is sound: every repo that a blocked_by reference or a temporary ID resolves to is now checked against the same allowed_repos policy before any API call. The link_sub_issue effective-repo check also runs before any issue read or mutation. No blocking issues found.

📋 Key Themes & Highlights

Key Themes

  • Case-sensitive repo matching: blocker repo comparison is exact, while the dedupe key is lowercased. This fails closed, but it may reject valid mixed-case references (inline comment on create_issue.cjs:904).
  • Ordering change: mention resolution moved after blocked_by validation. This is correct, but nothing enforces it yet (inline comment on create_issue.cjs:911).

Positive Highlights

  • ✅ Validation runs before any API call, and the tests assert zero API calls for disallowed blockers.
  • ✅ Staged mode rejects disallowed previews, and deferred revalidation is covered.
  • ✅ The link_sub_issue change keeps the parent and sub-issue in the same repo, so it cannot be used to cross repos.
  • ✅ Docs for the blocked-by policy match the code.

Verification Limits

Vitest could not run in this sandbox (npm registry TLS failure), so I could not reproduce the 158 test results claimed in the PR. I reviewed the logic statically and syntax-checked both changed files with node --check. Please confirm the test suite in CI.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again

Comment thread actions/setup/js/create_issue.cjs Resolved
Comment thread actions/setup/js/create_issue.cjs Resolved
Clarify target-or-allowlist documentation and existing case-sensitive matching. Add non-vacuous mention lookup ordering and mixed-case rejection regressions.

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

pelikhan commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

In response to #73882 (comment): No change needed for this completion notice or the associated review, which reported no actionable issues. The follow-up batch in a2b7df6 passes 161 focused tests, type checking, and the build/lint gate.

@pelikhan

pelikhan commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

In response to #73882 (comment): No change needed because the design gate provided no actionable design request or ADR draft. Kept this batch scoped to documentation clarity and regression coverage without changing the shared authorization semantics.

@pelikhan

pelikhan commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

In response to #73882 (comment): No change needed for this no-action completion notice. Independently added non-vacuous mention-ordering and mixed-case rejection regressions in a2b7df6; the combined focused suites now pass 161 tests.

@pelikhan

pelikhan commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

In response to #73882 (comment): Addressed both associated skills-review comments in a2b7df6 with an active mention-lookup regression and mixed-case fail-closed tests, documenting the existing exact-case policy. Local validation passes 161 focused tests, type checking, and the build/lint gate; the pre-batch CI JavaScript shards and type check also passed.

@pelikhan

pelikhan commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

In response to #73882 (comment): No change needed because this reviewer reported no actionable request. The separate actionable inline feedback has been addressed and all three threads resolved.

Specify target-or-allowlist authorization for blocked-by references and sub-issue links, including deferred and staged behavior. Add a bounded TLA+ model with negative controls and reachability witnesses to the checksum-pinned checker.

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

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.0

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.

2 participants