Intel

AIKIDO-2026-646955

emnapi is vulnerable to Type Confusion

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Sep 23, 2026
September 23, 2026

78

CVE Score

High

Type Confusion

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.

How do I fix this?

Upgrade the emnapi library to the patch version.

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.

Package

Versions

0.31.0 - 1.11.2

Fixed in 1.11.3

Background info

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

Get secure today,
quickly and for free.

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.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea