GHSL-2024-169: Poisoned Pipeline Execution (PPE) leads to potential repository takeover in Arduino-ESP32 - CVE-2024-45798
The tests_results workflow downloads artifacts from a triggering workflow and uses attacker-controlled values from those artifacts to build a JavaScript script and environment variables. An attacker could inject code into the script or environment, gaining a high-privileged token that may allow repository takeover.
Originally disclosed on GitHub Security Lab
Arduino-esp32 is vulnerable to Poisoned Pipeline Execution (PPE) allowing malicious actors to take over the repository.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The workflow used untrusted artifact contents directly in a JavaScript script and in environment variable definitions without sanitisation.
Impact
This issue may lead to a repository takeover since it will grant an attacker a GITHUB_TOKEN with write permissions to actions, checks, contents, pull requests, and statuses.
What the attacker needed
Ability to create a pull request; repository uses vulnerable workflow
The fix
The workflow should avoid using untrusted artifact data directly in scripts and environment variables, for example by using safe encoding or validation.
How it was found
- Clone the repository.
- Edit the tests_wokwi.yml workflow to upload a malicious artifact containing a crafted ref.txt file.
- Create a pull request with the change.
- The modified workflow runs on pull_request and uploads the artifact.
- Upon completion, the vulnerable tests_results workflow downloads the artifact and uses its contents to modify the JavaScript script.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This is a bug in an automated build system (GitHub Actions). A workflow that runs after another workflow trusts files (artifacts) that an attacker can control by opening a pull request. The attacker can put special text in those files that gets treated as code, letting them run commands with powerful permissions.