Skip to content

[Security] fix pull_request_target workflow injection (pwn request)#2989

Merged
dpfaffenbauer merged 1 commit into5.0from
fix/pull-request-target-cve
Apr 15, 2026
Merged

[Security] fix pull_request_target workflow injection (pwn request)#2989
dpfaffenbauer merged 1 commit into5.0from
fix/pull-request-target-cve

Conversation

@dpfaffenbauer
Copy link
Copy Markdown
Member

Summary

Fixes a workflow injection vulnerability (GitHub's ""pwn request"" pattern) in multiple CI workflows that used pull_request_target together with a checkout of the PR head. This gave untrusted fork PRs access to repository secrets (PIMCORE_SECRET, PIMCORE_INSTANCE_IDENTIFIER, PIMCORE_PRODUCT_KEY) and GITHUB_TOKEN write permissions — exploitable via modified composer.json scripts, PHP files loaded during phpstan/psalm, etc.

Changes

  • static.yml, license-check.yaml, packages_bundles.yml, packages_components.yml: switched trigger from pull_request_target to pull_request, removed fork-checkout steps
  • behat.yml, behat_ui.yml: removed dead pull_request_target conditional checkout steps (trigger was already pull_request)
  • docs_next.yml: switched to pull_request for consistency

cla-check.yml is intentionally kept on pull_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_target flow for approved external contributors if needed.

🤖 Generated with Claude Code

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>
@sonarqubecloud
Copy link
Copy Markdown

@dpfaffenbauer dpfaffenbauer merged commit 7690306 into 5.0 Apr 15, 2026
446 of 833 checks passed
@dpfaffenbauer dpfaffenbauer deleted the fix/pull-request-target-cve branch April 15, 2026 09:10
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant