---
id: "CVE-2026-120440"
kind: "vulnerability"
aliases: ["CVE-2026-120440"]
title: "QuickJS-NG: memory leak in Atomics.store lets scripts exhaust heap"
severity: "medium"
cvss: 6.9
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["embedded-js", "javascript-engine", "quickjs-ng", "runtime"]
not_affected_if: ["no-quickjs-ng", "quickjs-ng-0.16.0-or-later", "trusted-scripts-only"]
published_at: "2026-11-02T15:17:26+00:00"
first_seen_at: "2026-11-02T15:24:02+00:00"
updated_at: "2026-11-02T15:26:12+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120440", "first_seen_at": "2026-11-02T15:24:02+00:00"}]
---

# QuickJS-NG: memory leak in Atomics.store lets scripts exhaust heap

QuickJS-NG before 0.16.0 leaks the converted value in js_atomics_store() when it returns a RangeError. A script that repeatedly calls Atomics.store with a crafted valueOf can exhaust heap memory and cause a denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed QuickJS-NG version, for example by looking at the version in the build or package you ship: `unknown` if the sources do not give the command.
- Look for any embedding that runs untrusted JavaScript through QuickJS-NG.

## Fix

- QuickJS-NG: move to `0.16.0` or later.

## Timeline

- 2026-11-02T15:24:02+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-120440

## Documents

- [advisory] Vendor advisory: github.com https://github.com/quickjs-ng/quickjs/security/advisories/GHSA-wm7w-r6qf-3c9w
- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/quickjs-ng-before-0.16.0-memory-leak-via-atomics-store
- [fix] Patch: github.com https://github.com/quickjs-ng/quickjs/commit/62951e1bc68711d37aad986ff84ef0fe17038a7e
- [fix] Release notes: github.com https://github.com/quickjs-ng/quickjs/releases/tag/v0.16.0

## From the sources

QuickJS-NG before 0.16.0 contains a memory leak vulnerability in js_atomics_store() in quickjs.c that fails to free the converted value when returning a RangeError. Attackers running JavaScript can repeatedly call Atomics.store with a valueOf that detaches or shrinks the buffer to exhaust heap memory and cause denial of service.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
