CVE-2026-120439

QuickJS-NG before 0.16.0 Heap Buffer Overflow via TypedArray.prototype.sort

Published Nov 2, 2026 CVSS 4.0 · 8.3 High EPSS < 1% KEV · Not listed
Description
QuickJS-NG before 0.16.0 contains an integer overflow in js_typed_array_sort() in quickjs.c that allows attackers to cause a heap buffer overflow on 32-bit hosts. Attackers who can run JavaScript can call TypedArray.prototype.sort with a comparator on a typed array near 2^30 elements, wrapping the allocation size and writing indices past the buffer to crash or potentially execute code.

Analysis

AI-generated

Technical impact

QuickJS‑NG before version 0.16.0 contains an integer overflow in the js_typed_array_sort function that can be triggered by calling TypedArray.prototype.sort with a custom comparator on a typed array approaching two to the thirty‑second elements. The overflow wraps the allocation size, allowing the routine to write indices beyond the intended buffer, which can result in a crash or, if exploited further, execution of arbitrary code on the host. The flaw violates integrity and may provide an attacker with full code‑execution capabilities on 32‑bit systems where the overflow resolves to a smaller allocation.

Affected Systems

Any installation of QuickJS‑NG with a version earlier than 0.16.0 that runs on a 32‑bit host is vulnerable. The vulnerability is tied to the QuickJS‑NG library itself and does not depend on specific operating system distributions or client platforms; any application that embeds or interprets JavaScript via this library can be affected.

Risk and Exploitability

The CVSS score of 8.3 indicates a high‑severity flaw, while the EPSS score is not publicly available, leaving the likelihood of exploitation uncertain but not negligible. The vulnerability is not yet listed in CISA’s KEV catalog. An attacker must be able to execute arbitrary JavaScript within the context of the vulnerable QuickJS‑NG instance; typical vectors include malicious web pages or scripts loaded into a vulnerable application. Once the attacker can run such code, they can trigger the heap buffer overflow and potentially gain code‑execution rights.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade QuickJS‑NG to version 0.16.0 or later to remove the integer‑overflow + heap‑overflow flaw.
  • If an upgrade is not immediately possible, constrain the use of TypedArray.prototype.sort by removing custom comparator functions or by wrapping the call in a security‑controlled environment that limits input size.
  • Implement an application‑level guard that validates a typed array’s length before sorting; reject or truncate arrays that approach the 2^30 element boundary to prevent the overflow.

Generated by OpenCVE AI on November 2, 2026 at 15:24 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Quickjs-ng
Quickjs-ng quickjs
Vendors & Products Quickjs-ng
Quickjs-ng quickjs
Type Values Removed Values Added
Description QuickJS-NG before 0.16.0 contains an integer overflow in js_typed_array_sort() in quickjs.c that allows attackers to cause a heap buffer overflow on 32-bit hosts. Attackers who can run JavaScript can call TypedArray.prototype.sort with a comparator on a typed array near 2^30 elements, wrapping the allocation size and writing indices past the buffer to crash or potentially execute code.
Title QuickJS-NG before 0.16.0 Heap Buffer Overflow via TypedArray.prototype.sort
First Time appeared Quickjs Project
Quickjs Project quickjs
Weaknesses CWE-190
CPEs cpe:2.3:a:quickjs_project:quickjs:*:*:*:*:*:*:*:*
Vendors & Products Quickjs Project
Quickjs Project quickjs
References
Metrics cvssV3_1

{'score': 7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:H'}

cvssV4_0

{'score': 8.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Nov 6, 2026, 7:30 PM
Reserved
Nov 2, 2026, 12:42 PM
Status
Awaiting Analysis
Published
Nov 2, 2026, 3:17 PM
Modified
Nov 6, 2026, 8:17 PM