Intel

AIKIDO-2026-646955

emnapi is vulnerable to Type Confusion

Type Confusion Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 2 days ago

78

High Risk

This Affects:

JSemnapi
0.31.0 - 1.11.2
Fixed in 1.11.3
Are you affected? Scan for Free

TL;DR

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.

Who does this affect?

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.

Background info

emnapi is vulnerable to Type Confusion in versions 0.31.0 - 1.11.2.

How to fix this

Upgrade the emnapi library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform