CoreShop Remote Code Execution via Malicious Pull Request
CoreShop is vulnerable to remote code execution (RCE) via insecure `pull_request_target` configuration, allowing attackers to execute arbitrary code on the GitHub Actions runner by submitting a malicious pull request and potentially exfiltrate secrets or modify repository contents; tracked as CVE-2026-41249.
CoreShop is vulnerable to a remote code execution (RCE) vulnerability (CVE-2026-41249) due to an insecure configuration of the pull_request_target trigger in its GitHub Actions workflow (.github/workflows/static.yml). The workflow dangerously checks out unverified code from the pull request head (ref: ${{ github.event.pull_request.head.ref }}) and executes a script (bin/console) from this untrusted checkout. This allows any external attacker to achieve Remote Code Execution (RCE) on the GitHub Actions runner simply by submitting a malicious Pull Request, also known as a “Pwn Request” vulnerability. The vulnerable version is confirmed to be 5.0.0 of the CoreShop component.
Attack Chain
- An attacker forks the target CoreShop repository.
- The attacker modifies a file within the forked repository that satisfies the
pathscondition defined in thestatic.ymlworkflow, such assrc/dummy.phporcomposer.json. - The attacker crafts a malicious payload and injects it into the
bin/consolefile within their forked repository. This payload is designed to execute arbitrary commands on the GitHub Actions runner. - The attacker commits the changes, including the modified
bin/consolefile, to their forked repository. - The attacker opens a pull request (PR) targeting the
5.0ornextbranch of the original CoreShop repository. - The
Static Testsworkflow is automatically triggered upon receiving the pull request. - The workflow executes the
bin/consolescript from the attacker’s branch, resulting in the execution of the malicious payload within the GitHub Actions runner environment. - The attacker obtains RCE within the runner’s context, gaining access to secrets and potentially modifying repository contents.
Impact
Successful exploitation allows an attacker to execute arbitrary code within the GitHub Actions runner environment. Because pull_request_target runs in the context of the base repository, the runner has access to repository secrets (e.g., PIMCORE_SECRET, PIMCORE_PRODUCT_KEY) loaded in the environment. An attacker can exfiltrate these secrets, modify repository contents (if the token has write permissions), or abuse the runner’s computing resources. This can lead to sensitive data exposure, code tampering, and resource hijacking.
Recommendation
- Modify the GitHub Actions workflow (
.github/workflows/static.yml) to avoid checking out untrusted PR code (head.ref) when usingpull_request_target. - Implement a separated architecture using the
workflow_runevent, as suggested in the overview. - Monitor GitHub Actions logs for suspicious execution of
bin/consolewith unexpected commands, using the detection rules provided below. - Apply the recommended mitigation from the advisory (https://github.com/advisories/GHSA-q58j-g3f4-h26h).
Detection coverage 2
Detect GitHub Actions Workflow Command Injection via bin/console
highDetects potential command injection attempts in GitHub Actions workflows by monitoring the execution of `bin/console` with suspicious command-line arguments.
Detect Github Actions workflow modification
mediumDetects modification to Github Actions workflow files
Detection queries are available on the platform. Get full rules →