CVE-2023-22499 in Denoinfo

Summary

by MITRE • 01/18/2023

Deno is a runtime for JavaScript and TypeScript that uses V8 and is built in Rust. Multi-threaded programs were able to spoof interactive permission prompt by rewriting the prompt to suggest that program is waiting on user confirmation to unrelated action. A malicious program could clear the terminal screen after permission prompt was shown and write a generic message. This situation impacts users who use Web Worker API and relied on interactive permission prompt. The reproduction is very timing sensitive and can’t be reliably reproduced on every try. This problem can not be exploited on systems that do not attach an interactive prompt (for example headless servers). The problem has been fixed in Deno v1.29.3; it is recommended all users update to this version. Users are advised to upgrade. Users unable to upgrade may run with --no-prompt flag to disable interactive permission prompts.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 02/14/2023

The vulnerability described in CVE-2023-22499 affects Deno, a JavaScript and TypeScript runtime built on V8 and Rust, specifically targeting the handling of interactive permission prompts in multi-threaded environments. This security flaw stems from the improper management of terminal output during permission request sequences, creating a potential for user deception through visual manipulation of the command line interface. The issue manifests when multi-threaded programs can manipulate the terminal display to obscure or misrepresent the actual permission request being made. The vulnerability is categorized under CWE-693 Protection Mechanism Failure, as it represents a breakdown in the permission system's ability to maintain proper user awareness during security-sensitive operations. The flaw specifically impacts users who rely on interactive permission prompts when utilizing the Web Worker API, where separate threads can interfere with the expected user interaction flow. Attackers can exploit this timing-sensitive vulnerability by clearing the terminal screen after a permission prompt appears and replacing it with misleading information, potentially causing users to unknowingly grant permissions for unrelated actions. This type of attack aligns with ATT&CK technique T1059.007 for Command and Scripting Interpreter, where the deception occurs through terminal manipulation rather than direct code execution.

The operational impact of this vulnerability extends beyond simple user confusion to potentially enable more serious security breaches. When users cannot properly distinguish between legitimate and fraudulent permission requests, they may inadvertently grant access to malicious operations that would otherwise be blocked. The timing sensitivity of the exploit makes it particularly challenging to detect and prevent, as it requires precise coordination between multiple threads and terminal manipulation. This vulnerability is especially dangerous in environments where users frequently interact with the command line and rely on visual cues for security decisions. The issue cannot be exploited on headless servers or systems without interactive prompts, which limits its scope but does not eliminate the risk for interactive environments. The exploitation requires specific conditions including multi-threaded execution and access to terminal manipulation capabilities, making it more targeted but still potentially impactful for users running Deno applications in interactive mode. The vulnerability affects the core security model of Deno's permission system, undermining user trust in the permission prompt mechanism that is designed to protect against unauthorized access.

The fix implemented in Deno version 1.29.3 addresses the core issue by ensuring proper synchronization of terminal output during permission prompt sequences, preventing malicious programs from rewriting or clearing the display after prompts are shown. This update resolves the thread safety concerns in the permission prompt handling mechanism and enforces proper isolation between different execution contexts. Organizations using Deno should prioritize upgrading to version 1.29.3 or later to mitigate this vulnerability, as the fix directly addresses the root cause of the terminal manipulation attack vector. For users unable to immediately upgrade, the recommended mitigation is to run Deno with the --no-prompt flag, which disables interactive permission prompts entirely and prevents the vulnerability from being exploitable. This approach, while effective, reduces the security benefits of interactive prompts and should only be used as a temporary workaround. System administrators should also consider monitoring for potential exploitation attempts and implementing additional security controls around Deno usage, particularly in environments where users might be targeted by such deception attacks. The vulnerability highlights the importance of proper thread synchronization in security-sensitive contexts and demonstrates how seemingly minor UI handling issues can create significant security risks. Organizations should review their Deno deployment practices and ensure that all systems are updated to the patched version to maintain the integrity of their permission handling mechanisms and prevent potential exploitation.

Responsible

GitHub, Inc.

Reservation

12/29/2022

Disclosure

01/18/2023

Moderation

accepted

CPE

ready

EPSS

0.00601

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!