[Security] fix pull_request_target workflow injection (pwn request)#3115
Open
dpfaffenbauer wants to merge 1 commit into
Open
[Security] fix pull_request_target workflow injection (pwn request)#3115dpfaffenbauer wants to merge 1 commit into
dpfaffenbauer wants to merge 1 commit into
Conversation
Switch fork-checkout CI workflows from pull_request_target to pull_request so untrusted fork code no longer runs with secrets and a writable token. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
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.



Security: fix
pull_request_targetpwn-request vulnerabilityThe CI workflows below trigger on
pull_request_targetand check out the PR head from the fork (ref: …head.sha,repository: …head.repo.full_name). That runs untrusted fork code in the trusted base-repo context — with access to repository secrets (PIMCORE_PRODUCT_KEY,PIMCORE_INSTANCE_IDENTIFIER,PIMCORE_SECRET) and a writableGITHUB_TOKEN. This is the classic "pwn request" pattern;actions/checkout@v6now hard-blocks it.Fix
Switch these workflows from
pull_request_targettopull_request. Fork PRs then run in the fork's restricted context: no secrets, read-only token. The same code still runs, but there is nothing sensitive to steal and nothing to push — the trust boundary is respected.Trade-off: fork PRs no longer receive the Pimcore secrets. Same-repo branches/PRs and
pushkeep them. Ifpimcore-installrequires the product key, external fork PRs may fail at install and need a key-less test install path.cla-check.ymlintentionally keepspull_request_target— it only reads PR metadata / comments and never checks out fork code, which is the safe use of that trigger.Affected files (this branch):
behat.yml,behat_ui.yml,license-check.yaml,packages_bundles.yml,packages_components.yml,static.yml.🤖 Generated with Claude Code