CVE-2024-27935: Deno Deno's Node.js Compatibility Runtime Has Vulnerability
HIGHCVE-2024-27935 is a HIGH (CVSS 7.2) deno's node.js compatibility runtime has vulnerability (CWE-488: Exposure of Data Element to Wrong Session) affecting Deno libraries in the crates.io ecosystem. The issue involves deno's node.js compatibility runtime has cross-session data contamination. Remediation is available by upgrading affected packages to version 1.36.3.
CVE-2024-27935 at a Glance
Security Impact
CVSS: 7.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:L).
How to Fix CVE-2024-27935
To remediate this vulnerability, upgrade all affected Deno dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade deno to 1.36.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for deno
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-27935, inspect your project dependencies for Deno:
inspect dependencies for deno
Analyze the terminal output to locate any version of Deno in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.36.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-488: Exposure of Data Element to Wrong Session, where 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. In Deno, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-27935 Affected Deno Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
deno
|
crates.io |
≥ 1.35.1
< 1.36.3
|
1.36.3
|
References
Frequently Asked Questions
What is CVE-2024-27935?
Which Deno versions are affected?
What version fixes CVE-2024-27935?
Is deno affected?
What is the CVSS score of CVE-2024-27935?
What CWE is associated with CVE-2024-27935?
How can I check crates.io dependencies for CVE-2024-27935?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wrqv-pf6j-mqjp",
"modified" : "2024-03-21T18:29:19Z",
"published" : "2024-03-05T20:49:14Z",
"aliases" : [ "CVE-2024-27935" ],
"summary" : "Deno's Node.js Compatibility Runtime has Cross-Session Data Contamination",
"details" : "### Summary\n\nA 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.\n\n### Details\n\nA 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.\n\nThis buffer was introduced as a performance optimization to avoid excessive allocations during network read operations.\n\nIn cases where the [net.Stream](https://nodejs.org/api/net.html) 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.\n\nIt is important to note that this vulnerability does not affect Deno network streams created with the `Deno.listen` and `Deno.connect` APIs. \n\nThe 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.\n\n### PoC\n\nhttps://github.com/denoland/deno/issues/20188\n\n### Impact\n\nThis 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.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "deno"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.35.1"
}, {
"fixed" : "1.36.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/denoland/deno/security/advisories/GHSA-wrqv-pf6j-mqjp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-27935"
}, {
"type" : "WEB",
"url" : "https://github.com/denoland/deno/issues/20188"
}, {
"type" : "WEB",
"url" : "https://github.com/denoland/deno/commit/3e9fb8aafd9834ebacd27734cea4310caaf794c6"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/denoland/deno"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-488" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-03-05T20:49:14Z",
"nvd_published_at" : "2024-03-21T02:52:22Z"
}
}