[Security] fix pull_request_target workflow injection (pwn request)#2989
Merged
dpfaffenbauer merged 1 commit into5.0from Apr 15, 2026
Merged
[Security] fix pull_request_target workflow injection (pwn request)#2989dpfaffenbauer merged 1 commit into5.0from
dpfaffenbauer merged 1 commit into5.0from
Conversation
Switch pull_request_target to pull_request on workflows that checkout and execute code from PR forks. Running untrusted fork code with pull_request_target exposes repository secrets (PIMCORE_SECRET, PIMCORE_INSTANCE_IDENTIFIER, PIMCORE_PRODUCT_KEY) and GITHUB_TOKEN write permissions via composer scripts, modified source files, etc. Affected workflows: - static.yml, license-check.yaml, packages_bundles.yml, packages_components.yml: switched trigger to pull_request - behat.yml, behat_ui.yml: removed dead pull_request_target checkout steps (trigger was already pull_request) - docs_next.yml: switched to pull_request for consistency cla-check.yml intentionally kept on pull_request_target — it does not check out PR code, which is the safe usage pattern. Co-Authored-By: Claude Opus 4.6 (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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Summary
Fixes a workflow injection vulnerability (GitHub's ""pwn request"" pattern) in multiple CI workflows that used
pull_request_targettogether with a checkout of the PR head. This gave untrusted fork PRs access to repository secrets (PIMCORE_SECRET,PIMCORE_INSTANCE_IDENTIFIER,PIMCORE_PRODUCT_KEY) andGITHUB_TOKENwrite permissions — exploitable via modifiedcomposer.jsonscripts, PHP files loaded duringphpstan/psalm, etc.Changes
static.yml,license-check.yaml,packages_bundles.yml,packages_components.yml: switched trigger frompull_request_targettopull_request, removed fork-checkout stepsbehat.yml,behat_ui.yml: removed deadpull_request_targetconditional checkout steps (trigger was alreadypull_request)docs_next.yml: switched topull_requestfor consistencycla-check.ymlis intentionally kept onpull_request_target— it does not check out PR code, which is the safe usage pattern.Test plan
Note on external fork PRs
After this fix, external fork PRs will no longer receive secrets (which is the whole point of the fix). Fork PRs that need Pimcore licensing secrets will fail CI. A follow-up can add a label-gated
pull_request_targetflow for approved external contributors if needed.🤖 Generated with Claude Code