CVE-2024-42471 Arbitrary File Write via artifact extraction in actions/artifact

High 7.3 Published Updated

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.

PackageAffectedFixed in
@actions/artifact npmFrom 2.0.02.1.2
@actions/artifact npmFrom 2.0.02.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.

Is CVE-2024-42471 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free