emnapi is vulnerable to Type Confusion
78
High Risk
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.
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.
emnapi is vulnerable to Type Confusion in versions 0.31.0 - 1.11.2.
Upgrade the emnapi library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

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.