CVE-2024-42471 Arbitrary File Write via artifact extraction in actions/artifact
Attackers can write arbitrary files via path traversal in crafted artifacts, affecting GitHub Actions toolkit users.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2024-42471?
CVE-2024-42471 is a high-severity path traversal vulnerability in actions toolkit, published on 2 Sep 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
actions/artifact is the GitHub ToolKit for developing GitHub Actions. Versions of `actions/artifact` on the 2.x branch before 2.1.2 are vulnerable to arbitrary file write when using `downloadArtifactInternal`, `downloadArtifactPublic`, or `streamExtractExternal` for extracting a specifically crafted artifact that contains path traversal filenames. Users are advised to upgrade to version 2.1.2 or higher. There are no known workarounds for this issue.
Weakness: CWE-22
Which versions are affected by CVE-2024-42471?
2 open source packages ship an affected version, including @actions/artifact. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
@actions/artifact npm | From 2.0.0 | 2.1.2 |
@actions/artifact npm | From 2.0.0 | 2.1.2 |
Products include Github Actions\/Artifact, Github Actions Toolkit.
How do I fix CVE-2024-42471?
Upgrade @actions/artifact to 2.1.2 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2024-42471 being exploited?
There is no known exploitation of CVE-2024-42471 in the wild and no public exploit code.
Public exploit code: 1 Exploit-DB entry and 1 proofs of concept on GitHub.
Sources
Also known as GHSA-6q32-hq47-5qq3.