Skip to content

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

Open
dpfaffenbauer wants to merge 3 commits into
5.1from
fix/pull-request-target-pwn-5.1
Open

[Security] fix pull_request_target workflow injection (pwn request)#3116
dpfaffenbauer wants to merge 3 commits into
5.1from
fix/pull-request-target-pwn-5.1

Conversation

@dpfaffenbauer

Copy link
Copy Markdown
Member

Security: fix pull_request_target pwn-request vulnerability

CI workflows here trigger on pull_request_target while checking 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 repository secrets (PIMCORE_PRODUCT_KEY, PIMCORE_INSTANCE_IDENTIFIER, PIMCORE_SECRET) and a writable GITHUB_TOKEN. Classic "pwn request"; actions/checkout@v6 now hard-blocks it (see failing job on #3113).

Fix

Switch these workflows from pull_request_target to pull_request, so fork PRs run in the fork's restricted context (no secrets, read-only token).

frontend-build.yaml additionally gets an if guard so it only runs for same-repo branches — it auto-commits built assets with a writable token, which a fork PR can't do under pull_request anyway.

cla-check.yml intentionally keeps pull_request_target (reads PR metadata only, no fork checkout).

Trade-off: fork PRs no longer receive Pimcore secrets. Same-repo branches/PRs and push keep them.

Affected files: behat.yml, behat_ui.yml, license-check.yaml, packages_bundles.yml, packages_components.yml, static.yml, frontend-build.yaml.

One of a set of PRs across supported branches (5.0 → 5.1 → 2026.x); 4.1 was already fixed. Each branch fixed independently because affected file sets differ.

🤖 Generated with Claude Code

dpfaffenbauer and others added 3 commits July 24, 2026 18:30
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.
Restrict frontend-build (auto-commit, write token) to same-repo branches.

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