Read the docs
TI-2022-26579 Aliases GHSA-8mj7-wxmc-f424

Use after free in Neon external buffers

Priority LOW 38Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
—
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub.

Summary

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) } ```

Why it matters now

Fix Fixed neon (crates.io): 0.10.1

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—neon (crates.io)0.8.0 to before 0.10.10.10.1Patch availableGHSA-8mj7-wxmc-f424
  • neon (crates.io) Vendor— Affected 0.8.0 to before 0.10.1 Fixed in 0.10.1 Patch available GHSA-8mj7-wxmc-f424

Remediation

  • Fix · GHSA-8mj7-wxmc-f424 neon (crates.io) Fixed in 0.10.1 Advisory →

Timeline

  1. 2026-10-03 Threatist record created from GHSA-8mj7-wxmc-f424

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences