emnapi is vulnerable to Type Confusion
78
CVE Score
High
Type Confusion
emnapi's Node-API bridge functions napi_get_arraybuffer_info, napi_get_typedarray_info, and napi_get_buffer_info read the metadata (byteLength, length, byteOffset, buffer) of a caller-supplied buffer or typed array through direct property access and instanceof checks. A JavaScript object crafted to look like a typed array or ArrayBuffer can override these own properties or accessors to report a byteLength or length larger than its actual backing memory, so a native addon that trusts the returned metadata for a raw memory copy can read or write past the real buffer bounds. The fix reads buffer and view metadata through cached intrinsic prototype getters and ArrayBuffer.isView/Symbol.toStringTag checks instead of the object's own accessors, so spoofed own properties can no longer influence the returned size or pointer.
Upgrade the emnapi library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and a native addon built with emnapi calls napi_get_arraybuffer_info, napi_get_typedarray_info, or napi_get_buffer_info on a JavaScript value that is not fully trusted.
0.31.0 - 1.11.2
Fixed in 1.11.3emnapi is vulnerable to Type Confusion in versions 0.31.0 - 1.11.2.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.