Skip to content

GHSA-wrqv-pf6j-mqjp CVE-2024-27935

Deno's Node.js Compatibility Runtime has Cross-Session Data Contamination

High crates.io
Severity
7.2 / 10
High · CVSS 3.1
Exploit chance (EPSS)
0.72%
Chance of exploitation in the next 30 days. Higher than 54.01% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-488 Exposure of Data Element to Wrong Session
Fix
1.36.3
Upgrade deno to this version or later

Description

Summary

A vulnerability in Deno's Node.js compatibility runtime allows for cross-session data contamination during simultaneous asynchronous reads from Node.js streams sourced from sockets or files. The issue arises from the re-use of a global buffer (BUF) in stream_wrap.ts used as a performance optimization to limit allocations during these asynchronous read operations. This can lead to data intended for one session being received by another session, potentially resulting in data corruption and unexpected behavior.

Details

A bug in Deno's Node.js compatibility runtime results in data cross-reception during simultaneous asynchronous reads from Node.js network streams. When multiple independent network socket connections are involved, this vulnerability can be triggered. For instance, two separate server sockets that receive data from their respective client sockets and then echo the received data back to the client using Node.js streams may experience an issue where data from one socket may appear on another socket. Due to the improper isolation of the global buffer (BUF), data sent by one socket can end up being incorrectly received by another socket. Consequently, data intended for one session may be exposed to another session, potentially leading to data corruption and unexpected behavior.

This buffer was introduced as a performance optimization to avoid excessive allocations during network read operations.

In cases where the net.Stream is connected to a remote server such as a database or key/value store such as Redis, this may result in a packet received on one connection being presented to another, causing data cross-contamination between multiple users and potentially leaking sensitive information.

It is important to note that this vulnerability does not affect Deno network streams created with the Deno.listen and Deno.connect APIs.

The impact of this issue may extend beyond node.js network streams, however, and may also affect asynchronous reads from non-network node.js Stream such as those created from files.

PoC

https://github.com/denoland/deno/issues/20188

Impact

This affects all users of Deno that use the node.js compatibility layer for network communication or other streams, including packages that may require node.js libraries indirectly.

Affected versions

crates.io

PackageVulnerableFixed in
deno
>= 1.35.1, < 1.36.3
1.36.3

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

deno crates.io → 1.36.3

cargo
cargo update -p deno --precise 1.36.3

Severity breakdown

CVSS 3.1 7.2

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

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
Low
Integrity
None
Availability
Low

Weakness

CWE-488: Exposure of Data Element to Wrong Session

The product does not sufficiently enforce boundaries between the states of different sessions, causing data to be provided to, or used by, the wrong session.

How to prevent it
  • Architecture and Design: Protect the application's sessions from information leakage. Make sure that a session's data is not used or visible by other sessions.
  • Testing: Use a static analysis tool to scan the code for information leakage vulnerabilities (e.g. Singleton Member Field).
  • Architecture and Design: In a multithreading environment, storing user data in Servlet member fields introduces a data access race condition. Do not use member fields to store information in the Servlet.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-x2qc-cmh9-f4hf
Deno: Denial of service via non-ASCII bytes in WebSocket response headers
Medium Also affects deno
GHSA-8xpq-cjcf-3wh9
Deno: Permission Bypass via Unicode Normalization Mismatch on macOS (APFS)
High Also affects deno
GHSA-968w-xfqw-vp9q
Deno: BYONM module resolution allows `package.json` main path traversal to bypass `--allow-read` restrictions
Medium Also affects deno
GHSA-v8fw-85r8-5m23
Deno: Node TCPWrap numeric hostname aliases bypass --deny-net resolved-IP deny checks
Medium Also affects deno
GHSA-9xg4-qhm4-g43w
Deno: Miller-Rabin Primality Test Allows Zero Rounds
High Also affects deno
GHSA-7xh3-mhg9-jcw8
Deno: Command Injection via spawnSync & spawn on Windows
High Also affects deno
GHSA-4c8g-jvcx-v4hv
Deno: process.loadEnvFile() bypasses env permission checks and mutates process.env with only read access
Medium Also affects deno
GHSA-83pc-3rw9-qpwj
Deno: WebSocket API sandbox bypass via missing post-DNS check
Medium Also affects deno
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor