CVE-2020-15228 Environment Variable Injection in GitHub Actions
Attackers can inject commands via stdout to modify environment variables or paths, potentially leading to code execution in GitHub Actions workflows.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2020-15228?
CVE-2020-15228 is a low-severity command injection vulnerability in actions toolkit, published on 1 Oct 2020. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
In the `@actions/core` npm module before version 1.2.6,`addPath` and `exportVariable` functions communicate with the Actions Runner over stdout by generating a string in a specific format. Workflows that log untrusted data to stdout may invoke these commands, resulting in the path or environment variables being modified without the intention of the workflow or action author. The runner will release an update that disables the `set-env` and `add-path` workflow commands in the near future. For now, users should upgrade to `@actions/core v1.2.6` or later, and replace any instance of the `set-env` or `add-path` commands in their workflows with the new Environment File Syntax. Workflows and actions using the old commands or older versions of the toolkit will start to warn, then error out during workflow execution.
Which versions are affected by CVE-2020-15228?
2 open source packages ship an affected version, including @actions/core. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
@actions/core npm | All versions | 1.2.6 |
@actions/core npm | All versions | 1.2.6 |
Products include Toolkit Project Toolkit.
How do I fix CVE-2020-15228?
Upgrade @actions/core to 1.2.6 or later.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2020-15228 being exploited?
There is no known exploitation of CVE-2020-15228 in the wild and no public exploit code.
Public exploit code: 1 proofs of concept on GitHub.
Sources
Also known as GHSA-mfwh-5m23-j46w.