GHSA-8mj7-wxmc-f424: Neon Use After Free Vulnerability
HIGHGHSA-8mj7-wxmc-f424 is a HIGH use after free vulnerability (General Security Weakness) affecting Neon libraries in the crates.io ecosystem. The issue involves use after free in neon external buffers. Remediation is available by upgrading affected packages to version 0.10.1.
GHSA-8mj7-wxmc-f424 at a Glance
How to Fix GHSA-8mj7-wxmc-f424
To remediate this vulnerability, upgrade all affected Neon 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 neon to 0.10.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for neon
How to Check if You Are Affected
To determine whether your application is affected by GHSA-8mj7-wxmc-f424, inspect your project dependencies for Neon:
inspect dependencies for neon
Analyze the terminal output to locate any version of Neon in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.10.1), 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 General Security Weakness. In Neon, 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
GHSA-8mj7-wxmc-f424 Affected Neon Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
neon
|
crates.io |
≥ 0.8.0
< 0.10.1
|
0.10.1
|
References
Frequently Asked Questions
What is GHSA-8mj7-wxmc-f424?
Which Neon versions are affected?
What version fixes GHSA-8mj7-wxmc-f424?
Is neon affected?
What CWE is associated with GHSA-8mj7-wxmc-f424?
How can I check crates.io dependencies for GHSA-8mj7-wxmc-f424?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8mj7-wxmc-f424",
"modified" : "2022-06-17T00:13:40Z",
"published" : "2022-06-17T00:13:40Z",
"aliases" : [ ],
"summary" : "Use after free in Neon external buffers",
"details" : "Neon provides functionality for creating JavaScript `ArrayBuffer` (and the `Buffer` subtype) instances backed by bytes allocated outside of V8/Node. The [`JsArrayBuffer::external`](https://docs.rs/neon/0.10.0/neon/types/struct.JsArrayBuffer.html#method.external) and [`JsBuffer::external`](https://docs.rs/neon/0.10.0/neon/types/struct.JsBuffer.html#method.external) did not require `T: 'static` prior to Neon `0.10.1`. This allowed creating an externally backed buffer from types that may be freed while they are still referenced by a JavaScript `ArrayBuffer`.\n\nThe following example demonstrates use after free. It compiles on versions `<0.10.1` and fails to compile afterward.\n\n```rust\npub fn soundness_hole(mut cx: FunctionContext) -> JsResult<JsArrayBuffer> {\n let mut data = vec![0u8, 1, 2, 3];\n \n // Creating an external from `&mut [u8]` instead of `Vec<u8>` since there is a blanket impl\n // of `AsMut<T> for &mut T`\n let buf = JsArrayBuffer::external(&mut cx, data.as_mut_slice());\n\n // `buf` is still holding a reference to `data`!\n drop(data);\n\n Ok(buf)\n}\n```\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "neon"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.8.0"
}, {
"fixed" : "0.10.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/neon-bindings/neon/issues/896"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/neon-bindings/neon"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2022-0028.html"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-17T00:13:40Z",
"nvd_published_at" : null
}
}