🛡️ GHSA-8mj7-wxmc-f424 — neon

🟠 CVSS 8.0 — High ✅ No Known Exploit OSV
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Use after free in Neon external buffers

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.

The following example demonstrates use after free. It compiles on versions <0.10.1 and fails to compile afterward.

```rust

pub fn soundness_hole(mut cx: FunctionContext) -> JsResult<JsArrayBuffer> {

let mut data = vec![0u8, 1, 2, 3];

// Creating an external from &mut [u8] instead of Vec<u8> since there is a blanket impl

// of AsMut<T> for &mut T

let buf = JsArrayBuffer::external(&mut cx, data.as_mut_slice());

// buf is still holding a reference to data!

drop(data);

Ok(buf)

}

```

Affected software

GHSA-8mj7-wxmc-f424 is recorded against 1 package.

  • neon

Timeline and source

Published on 17 June 2022 and last revised on 8 November 2023. No public exploit is currently recorded for this entry. Record sourced from OSV.

References

github.com (Web)
github.com (Package)
rustsec.org (Web)

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector N/A
CWE N/A
Public Exploit ✅ No
Source OSV
Published 2022-06-17
Updated 2026-08-20
Modified 2023-11-08
Fix URL N/A

Affected Packages

Software From version Fixed in
neon

Similar Threats

Site Security Check

Is neon part of your stack?

GHSA-8mj7-wxmc-f424 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesGitHub AdvisoryGitHub Advisory Undated