CVE-2024-27931 Insufficient permission checking in `Deno.makeTemp*` APIs

Medium 5.8 Published Updated

Attackers can create files outside allowed directories via path traversal in Deno temp APIs, potentially overwriting system files.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-27931?

CVE-2024-27931 is a medium-severity path traversal vulnerability in denoland deno, published on 5 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Deno is a JavaScript, TypeScript, and WebAssembly runtime with secure defaults. Insufficient validation of parameters in `Deno.makeTemp*` APIs would allow for creation of files outside of the allowed directories. This may allow the user to overwrite important files on the system that may affect other systems. A user may provide a prefix or suffix to a `Deno.makeTemp*` API containing path traversal characters. This is fixed in Deno 1.41.1.

Weakness: CWE-20

Which versions are affected by CVE-2024-27931?

2 open source packages ship an affected version, including deno. It affects 1 product.

PackageAffectedFixed in
deno crates.ioAll versions1.41.1
deno crates.ioAll versions1.41.1

Products include Deno Deno.

How do I fix CVE-2024-27931?

Upgrade deno to 1.41.1 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2024-27931 being exploited?

There is no known exploitation of CVE-2024-27931 in the wild and no public exploit code.

Sources

Also known as GHSA-hrqr-jv8w-v9jh, JLSEC-2026-103.

Is CVE-2024-27931 in your software?

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

Check your SBOMs for free