CVE-2024-27936: Deno interactive permission prompt spoofing via improper ANSI stripping

Published Mar 5, 2024
·
Updated

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, 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.

Other sources

Deno is a JavaScript, TypeScript, and WebAssembly runtime with secure defaults. Starting in version 1.32.1 and prior to version 1.41.0 of the deno library, maliciously crafted permission request can show the spoofed permission prompt by inserting a broken ANSI escape sequence into the request contents. 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. 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. Version 1.41.0 of the deno library contains a patch for the issue.

— MITRE

Affected Software

4 affected componentsFixes available
rust/deno_runtime>=0.103.0<0.147.0
0.147.0
rust/deno>=1.32.1<1.41.0
1.41.0
Deno Deno>=1.32.1<1.41.0
Deno Deno Runtime Rust>=0.103.0<0.147.0

Event History

Mar 5, 2024
Advisory Published
via GitHub·08:54 PM
Mar 6, 2024
CVE Published
via MITRE·09:05 PM
Data Sourced
via MITRE·09:05 PM
DescriptionSeverityWeakness
Mar 21, 2024
Data Sourced
via NVD·02:52 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the severity of CVE-2024-27936?

CVE-2024-27936 is a serious vulnerability due to its potential for spoofing permission prompts.

2

How do I fix CVE-2024-27936?

To fix CVE-2024-27936, update to Deno version 1.41.0 or Deno Runtime version 0.147.0 or later.

3

What software is affected by CVE-2024-27936?

CVE-2024-27936 affects Deno versions between 1.32.1 and 1.41.0 and Deno Runtime versions between 0.103.0 and 0.147.0.

4

What type of attack does CVE-2024-27936 enable?

CVE-2024-27936 enables attackers to display spoofed permission prompts through a crafted permission request.

5

What is the nature of the vulnerability in CVE-2024-27936?

The vulnerability in CVE-2024-27936 arises from the use of a broken ANSI escape sequence in permission requests.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203