SEC-005: Add cross-repository allowlist validation to flagged handlers#17771
SEC-005: Add cross-repository allowlist validation to flagged handlers#17771
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ Smoke test complete. Overall: PARTIAL. 15/17 tests passed, 1 failed (Serena find_symbol EOF), 1 skipped (close PR). Issue created, PR comment added, discussion comment added. |
|
✅ Commit pushed: |
There was a problem hiding this comment.
Pull request overview
This PR addresses SEC-005 conformance failures by adding cross-repository allowlist validation to three flagged handlers. The changes include a new shared validation utility, a security fix for mention pre-scanning, and documentation clarifying when cross-repo validation is not applicable.
Changes:
- Added
validateTargetRepowrapper function to provide a canonical named export for SEC-005 conformance checking - Fixed security vulnerability in
collect_ndjson_output.cjswhere user-suppliedpreview.repocould trigger GitHub API calls to arbitrary repositories during mention allowlist pre-scanning - Added security documentation to
assign_agent_helpers.cjsclarifying the caller validation contract for cross-repository PR creation - Documented that
submit_pr_review.cjsoperates exclusively on the triggering repository (regex false positive)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
actions/setup/js/repo_helpers.cjs |
Adds validateTargetRepo as a named export wrapping validateRepo to enable per-file SEC-005 conformance verification |
actions/setup/js/collect_ndjson_output.cjs |
Adds allowlist validation before GitHub API calls in the mention pre-scan loop to prevent unauthorized cross-repo queries |
actions/setup/js/assign_agent_helpers.cjs |
Documents that pullRequestRepoId parameter must be validated by callers before invoking this function |
actions/setup/js/submit_pr_review.cjs |
Clarifies that this handler only operates on the triggering repository and cross-repo validation is not applicable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Smoke test results
|
|
🤖 Smoke test results for
Overall:
|
There was a problem hiding this comment.
SEC-005 cross-repo allowlist validation looks solid. The validateTargetRepo call in collect_ndjson_output.cjs correctly gates cross-repo mention lookups before any API interaction, and the new named function in repo_helpers.cjs makes compliance auditing straightforward. Minor: the validateTargetRepo wrapper is thin — worth a clarifying comment or consolidation, but not a blocker.
📰 BREAKING: Report filed by Smoke Copilot
| getDefaultTargetRepo, | ||
| isRepoAllowed, | ||
| validateRepo, | ||
| validateTargetRepo, |
There was a problem hiding this comment.
The validateTargetRepo wrapper delegates directly to validateRepo. Consider documenting what differentiates the two functions semantically, or consolidating callers to use validateRepo directly to reduce indirection. That said, having a named function makes SEC-005 compliance auditing easier as noted in the JSDoc comment.
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Commit pushed: |
|
Smoke Test Results — Run §22284305292 Core tests:
PR review tests (#17771):
Overall: PARTIAL — Serena
|
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude
Three handlers failed the SEC-005 conformance check for cross-repository operations lacking allowlist validation. Two required real fixes; one was a regex false positive.
Changes
repo_helpers.cjs— new shared utilityvalidateTargetRepo(repo, defaultRepo, allowedRepos)as the canonical named function for cross-repo validation, enabling per-file conformance checks to pass and providing a reusable entry point.collect_ndjson_output.cjs— real security fix@mentionallowlisting. User-suppliedpreview.repocould overridetargetOwner/targetRepobefore any allowlist check, allowing the handler to query GitHub API for arbitrary repos.allowedReposfromsafeOutputsConfigand callsvalidateTargetRepobefore making any API call. Falls back to the triggering repo on failure.assign_agent_helpers.cjs— documentationpullRequestRepoId(used astargetRepositoryId) is already validated by its only meaningful caller (assign_to_agent.cjs) viavalidateRepobefore the Node ID is resolved. Added a security comment documenting this caller contract to make the requirement explicit.submit_pr_review.cjs— false positive"Set review context from target: ${repo}#..."). This handler exclusively targets the triggering repository. Added a comment documenting the N/A status.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw scripts/**/*.js 64/bin/go echo inte�� 64/bin/go go /usr/bin/git -json GO111MODULE 64/bin/go git(http block)https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha ry=1 /tmp/go-build640733343/b125/vet.cfg 733343/b387/_pkg_.a ripts/lint_errorgit ripts/lint_errorrev-parse 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build640733343/b202/vet.cfg 733343/b422/testutil.test 4474278/b412/_pkgit GO111MODULE 64/bin/go 733343/b422/testutil.test(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v3/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE a3e91bdcf233b55arev-parse GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet -uns�� runs/20260222-191752-30943/test-go1.25.0 cfg 733343/b338/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/x/tmp/go-build640733343/b431/_testmain.go(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linutest@example.com -uns�� runs/20260222-191752-30943/test-4097172866/.github/workflows /tmp/go-build640733343/b056/vet.cfg 733343/b336/vet.cfg l GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linuremote.origin.url(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha /github.com/owner/repo.git go /usr/bin/git -json GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git -json GO111MODULE x_amd64/vet git(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v5/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha t0 -buildtags(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel x_amd64/vet /usr/bin/git -json GO111MODULE x_amd64/vet git rev-�� --show-toplevel 8afRszc/J-5ptimqremote.origin.url /usr/bin/infocmp -json GO111MODULE x_amd64/vet infocmp(http block)https://api.github.com/repos/actions/github-script/git/ref/tags/v8/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha npx prettier --cGOSUMDB GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go sh -c "prettier" --check 'scripts/**/*GOINSECURE sh 64/bin/go "prettier" --wri/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet grep 64/bin/go go(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha k/gh-aw/gh-aw/pkg/stringutil/ansGOINSECURE k/gh-aw/gh-aw/pkg/stringutil/ideGOMOD 64/bin/go **/*.json --ignore-path ../../../.pretti-unreachable=false /opt/hostedtoolc/tmp/go-build640733343/b265/vet.cfg -o /tmp/go-build3764474278/b406/_pkGOINSECURE -trimpath 64/bin/go -p main -lang=go1.25 go(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha --check **/*.cjs 64/bin/go **/*.json --ignore-path run-script/lib/n-bool go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/actions/setup-go/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /ref/tags/v8 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x-test.short=true GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -uns�� 1752-30943/test-3566464338 /tmp/go-build640733343/b042/vet.cfg 733343/b342/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/actions/setup-node/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha 22 GO111MODULE Name,createdAt,startedAt,updated-buildmode=exe GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.0/x-extld=gcc -uns�� runs/20260222-191752-30943/test-2551296134/.github/workflows /tmp/go-build640733343/b044/vet.cfg 733343/b337/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts/usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts/usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet stlo�� -json cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuTest User(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts/usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/pkg/tool/linu-buildmode=exe GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linu/tmp/go-build640733343/b113/vet.cfg stlo�� -json cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 7KRlb0f/T36gUPQZorigin(http block)https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts/usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts/usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts/usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts/usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json cfg x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile(http block)https://api.github.com/repos/github/gh-aw/actions/workflows/usr/bin/gh gh workflow list --json name,state,path prettier --check 64/bin/go **/*.ts **/*.json --ignore-path /bin/sh -c echo "��� JavaSc-errorsas /bin/sh 64/bin/go -d grep 64/bin/go go(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 format:cjs 64/bin/go go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env 2325746449/.github/workflows cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999/usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json rty 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/nonexistent/repo/actions/runs/12345/usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/owner/repo/actions/workflows/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go **/*.ts **/*.json --ignore-path go env -json GOMOD 64/bin/go tierignore pkg/workflow/dep-atomic 64/bin/go go(http block)/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go **/*.ts **/*.json --ignore-path go env -json GOCACHE 64/bin/go tierignore grep 64/bin/go go(http block)https://api.github.com/repos/owner/repo/contents/file.md/tmp/go-build640733343/b381/cli.test /tmp/go-build640733343/b381/cli.test -test.testlogfile=/tmp/go-build640733343/b381/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE 4474278/b414/imp/tmp/go-build640733343/b117/vet.cfg /hom�� k/gh-aw/gh-aw/pkg/workflow/featuGOINSECURE k/gh-aw/gh-aw/pkg/workflow/imporGOMOD 64/bin/go **/*.json --ignore-path ../../../.pretti-bool /opt/hostedtoolc-buildtags(http block)https://api.github.com/repos/test-owner/test-repo/actions/secrets/usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name tions-lock.json pkg/workflow/data/action_pins.json; \ echo "��� Action pins synced successfully/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet --check 64/bin/go **/*.ts **/*.json --ignore-path node /hom�� --check scripts/**/*.js 64/bin/go .prettierignore ../../../pkg/wor-atomic 64/bin/go go(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Changeset
Warning
The following domain was blocked by the firewall during workflow execution:
github.com✨ PR Review Safe Output Test - Run 22284305292