Skip to content

Commit 0d20b7c

Browse files
DVHRMNTCBSLcopybara-github
authored andcommitted
fix: gate pr-triage secrets on same-repository pull_request_target
Merge #6053 ## What the patch does `pr-triage.yml` in `google/adk-python` runs on `pull_request_target` and mounts `ADK_TRIAGE_AGENT` and `GOOGLE_API_KEY` while the triage agent processes untrusted fork PR content. This patch adds a fork guard: automated `pull_request_target` runs only when `head.repo.full_name == github.repository`. Maintainers can still trigger via `workflow_dispatch`. **Pull request:** COLE_SEU_LINK_AQUI ## How it works - **Before:** CLA-signed fork PR could auto-trigger privileged triage agent with API secrets in environment. - **After:** External fork PRs no longer auto-run secret-backed triage; `workflow_dispatch` preserved. ## Writing effort Modest — coordinated `if:` guard in `.github/workflows/pr-triage.yml`. ## Security impact Compelling proactive hardening: prevents untrusted fork PR content from reaching privileged LLM CI with secrets. No live exploit was performed. Local trust-boundary simulation only. ## Project scope `google/adk-python` is OT1 in Google OSS repository tier. ## Relation to prior submissions Proactive patch; pivots from REPORT-002 OSS VRP GHA class. **This is the security patch PR**, not a duplicate VRP report. ## Diff access COLE_SEU_LINK_AQUI/files COPYBARA_INTEGRATE_REVIEW=#6053 from DVHRMNTCBSL:security/pr-analyze-fork-guard 7ec1ef0 PiperOrigin-RevId: 930315612
1 parent ea474e6 commit 0d20b7c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/pr-triage.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ on:
1212

1313
jobs:
1414
agent-triage-pull-request:
15-
if: github.event_name == 'workflow_dispatch' || !contains(github.event.pull_request.labels.*.name, 'google-contributor')
15+
if: >-
16+
github.event_name == 'workflow_dispatch' || (
17+
github.event.pull_request.head.repo.full_name == github.repository &&
18+
!contains(github.event.pull_request.labels.*.name, 'google-contributor')
19+
)
1620
runs-on: ubuntu-latest
1721
permissions:
1822
pull-requests: write

0 commit comments

Comments
 (0)