Security PoC: pull_request_target workflow checks out fork head#20
Closed
thom-pplx wants to merge 1 commit into
Closed
Security PoC: pull_request_target workflow checks out fork head#20thom-pplx wants to merge 1 commit into
thom-pplx wants to merge 1 commit into
Conversation
Contributor
Author
|
Observed proof from workflow run
This demonstrates the vulnerable condition without including any exploit payload: a fork-origin PR can trigger a base-repository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Non-destructive security PoC – DO NOT MERGE.
This draft PR is intentionally benign. It changes only
charts/pgcat/values.yamlby adding a comment marker so that the existing workflow path filter is satisfied.The proof condition is the PR shape, not the content:
thom-pplx/pgcat.github/workflows/generate-chart-readme.yaml:charts/*/values.yamlpull_request_targetcontents: writesecrets.GITHUB_TOKENThat combination means a fork-origin PR can cause the base repository workflow to run with elevated repository credentials while checking out attacker-controlled PR content.
No payload is included in this PR.
Recommended fix: replace this with a read-only
pull_requestcheck, remove write permissions from PR-triggered execution, or split the workflow so any write-back step runs only on trusted base-repo content.