Skip to content

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

Open
dpfaffenbauer wants to merge 1 commit into
5.0from
fix/pull-request-target-pwn-5.0
Open

[Security] fix pull_request_target workflow injection (pwn request)#3115
dpfaffenbauer wants to merge 1 commit into
5.0from
fix/pull-request-target-pwn-5.0

Conversation

@dpfaffenbauer

Copy link
Copy Markdown
Member

Security: fix pull_request_target pwn-request vulnerability

The CI workflows below trigger on pull_request_target and 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 writable GITHUB_TOKEN. This is the classic "pwn request" pattern; actions/checkout@v6 now hard-blocks it.

Fix

Switch these workflows from pull_request_target to pull_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 push keep them. If pimcore-install requires the product key, external fork PRs may fail at install and need a key-less test install path.

cla-check.yml intentionally keeps pull_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.

Part of a set of PRs fixing the same issue across supported branches (5.0 → 5.1 → 2026.x). 4.1 was already fixed. Each branch is fixed independently because the affected file sets differ per branch.

🤖 Generated with Claude Code

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>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant