Skip to main content

QuickJS CVE-2025-62495

HIGH
Integer Underflow (CWE-191)
2025-10-16 cve-coordination@google.com
7.1
CVSS 4.0 · Vendor: google
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit script/regex to QuickJS host
  2. Delivery
    Compile recursive pattern exceeding 2GB bytecode
  3. Exploit
    size_t truncated to negative signed int
  4. Execution
    Negative offset drives out-of-bounds put_u32 write
  5. Impact
    Corrupt host memory toward code execution

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer underflow checks
Exploitation Conditions

Requires the attacker to control a regular-expression pattern compiled by QuickJS's libregexp, and that pattern (e.g. the recursive PoC pattern) must produce more than 2^31 bytes (~2GB) of regex bytecode so the DynBuf size_t wraps to a negative signed 32-bit int. This is the specific, concrete prerequisite - not a vague 'configuration'. Strongly limiting factors: the multi-gigabyte bytecode requirement demands substantial host memory and a deliberately crafted recursive pattern (reflected as AC:H/AT:P), and the attacker must already be able to feed JavaScript/regex into the QuickJS-embedding application. There is no special product feature or non-default setting required - the flaw is in the core regex compiler - but the sheer size needed sharply constrains realistic, reliable exploitation.

Impact

Severity is driven by memory corruption potential (OOB write, CWE-191) rather than ease of exploitation. The provided CVSS 4.0 base score is 7.1 with a vector (AV:A/AC:H/AT:P/PR:L/UI:P) whose Attack Complexity High and Attack Requirement Present flags correctly signal that this is NOT a trivially triggerable bug: the description states the bytecode buffer must exceed 2^31 bytes (~2GB) before the signed-int wrap occurs, which demands an extraordinary amount of memory and a purpose-built recursive regex. No EPSS score is present in the input, so exploitation-probability cannot be quantified - STATE EXPLICITLY: EPSS missing. It is NOT in CISA KEV, so there is no evidence of active exploitation. A POC is publicly available (Google issuetracker 434196926, reporter cve-coordination@google.com), so publicly available exploit code exists, but POC availability is distinct from active exploitation and does not imply widespread attacks. Conflicting signal to verify: the input 4.0 vector uses AV:A (adjacent/network) and UI:P (passive user interaction), which is hard to reconcile with a library-internal regex-compiler bug - in practice the attacker must already supply a pattern to the embedding application, which is typically a local/script-execution context (AV:L), so the network-adjacent framing should be verified against the actual embedding. Net: a genuine memory-safety flaw and a useful sandbox-escape primitive for an attacker who can already run JavaScript/regex in a QuickJS host, but the ~2GB bytecode precondition makes it a lower real-world priority than the 7.1 score alone suggests - closer to targeted/opportunistic than mass-exploitable.

Exploit ScenarioDerived

An attacker who can submit JavaScript or a regular expression to an application embedding QuickJS crafts a deeply recursive pattern whose compiled libregexp bytecode exceeds 2GB; the size_t buffer length is truncated into a signed 32-bit int and wraps negative, so a jump-patch offset computed in re_parse_disjunction points before the buffer and put_u32 performs an out-of-bounds write into host-process memory. A public POC exists (Google issue tracker), but the multi-gigabyte memory requirement and AC:H/AT:P conditions make reliable triggering resource-intensive rather than casual.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 19, 2026

Integer overflow in QuickJS's libregexp bytecode accounting can become an out-of-bounds write when a crafted recursive regular expression expands compiled bytecode past 2^31 bytes; publicly available exploit code exists and no CISA KEV confirmation was provided. The authoritative assessment treats this as local with no required privileges (PR:N), but exploitation is difficult because the attacker must already be able to feed a regex into the QuickJS-embedding application and must induce a multi-gigabyte bytecode allocation, with high confidentiality, integrity, and availability impact in changed scope.

RemediationAI

No exact fixed version is specified in the provided data; monitor https://bellard.org/quickjs/Changelog for the corrected QuickJS release and apply it when available. Until then, prevent untrusted regex patterns from reaching libregexp or enforce a compiled-bytecode or pattern-size cap far below 2^31 bytes; this blocks the wraparound but will reject legitimately huge patterns, which are rare. Run QuickJS in a process with address-space or memory limits such as ulimit -v or a cgroup memory cap so a multi-gigabyte regex bytecode allocation fails before the signed-int boundary, at the cost of terminating or denying excessive workloads. Isolate regex compilation in a low-privilege sandbox and avoid compiling attacker-supplied patterns in privileged processes; these are compensating controls, not substitutes for an upstream fix. See https://bellard.org/quickjs/Changelog and https://issuetracker.google.com/434196926 for vendor and issue details.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The affected component is QuickJS's libregexp regular-expression compiler. Its bytecode buffer uses a DynBuf whose size member is size_t (unsigned, typically 64-bit), but helper routines such as re_emit_op_u32 and internal parsing code cast or store that size into a signed int (typically 32-bit). The root cause is CWE-191 integer underflow/wraparound: once a complex or recursive pattern drives compiled bytecode past 2^31 bytes, the stored size becomes negative when interpreted as an int; functions such as re_parse_disjunction use that negative value in offset arithmetic and then execute put_u32(s->byte_code.buf + pos, len), producing an out-of-bounds write. The NVD CPE cpe:2.3:a:quickjs_project:quickjs:*:*:*:*:*:*:*:* leaves versions unconstrained, so no precise vulnerable/fixed boundary is supplied in this dataset. The authoritative CVSS 3.1 assessment is AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H, emphasizing memory-corruption risk with difficult prerequisites; the supplied CVSS 4.0 vector differs on some metrics.

Know when Quickjs gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (google) PRIMARY 7.1 HIGH
CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:H/VA:L/SC:H/SI:H/SA:L
vuln.today AI 8.1 HIGH

Attacker must supply a regex to the local engine (AV:L) and build a ~2GB buffer (AC:H); no auth beyond script submission (PR:N/UI:N); OOB write escapes the JS sandbox into host memory (S:C, C/I/A:H).

3.1 AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
4.0 AV:L/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (google).

CVSS VectorVendor: google

Attack Vector
Adjacent
Attack Complexity
High
Attack Requirements
Present
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
Low

DescriptionCVE.org

An integer overflow vulnerability exists in the QuickJS regular expression engine (libregexp) due to an inconsistent representation of the bytecode buffer size.

  • The regular expression bytecode is stored in a DynBuf structure, which correctly uses a $\text{size}\_\text{t}$ (an unsigned type, typically 64-bit) for its size member.
  • However, several functions, such as re_emit_op_u32 and other internal parsing routines, incorrectly cast or store this DynBuf $\text{size}\_\text{t}$ value into a signed int (typically 32-bit).
  • When a large or complex regular expression (such as those generated by a recursive pattern in a Proof-of-Concept) causes the bytecode size to exceed $2^{31}$ bytes (the maximum positive value for a signed 32-bit integer), the size value wraps around, resulting in a negative integer when stored in the int variable (Integer Overflow).
  • This negative value is subsequently used in offset calculations. For example, within functions like re_parse_disjunction, the negative size is used to compute an offset (pos) for patching a jump instruction.
  • This negative offset is then incorrectly added to the buffer pointer (s->byte\_code.buf + pos), leading to an out-of-bounds write on the first line of the snippet below:

put_u32(s->byte_code.buf + pos, len);

Executive ViewAI

Why It Matters

QuickJS, a lightweight JavaScript engine embedded in various applications, contains a high-severity integer overflow in its libregexp bytecode accounting (CVE-2025-62495) that can lead to out-of-bounds writes when processing crafted recursive regular expressions. Although exploitation requires a local, unauthenticated attacker to supply a malicious regex and induce a multi-gigabyte allocation, publicly available exploit code exists and no vendor patch is available, creating potential confidentiality, integrity, and availability risk for products that accept untrusted regex input. Leadership should prioritize identifying affected embedded deployments and enforcing input and memory safeguards until a fix is released.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis; restrict untrusted regex input, enforce regex length/complexity and memory limits, sandbox QuickJS-embedded processes, apply least privilege, and monitor for anomalous allocations or crashes.

Threat Intelligence Overview

EPSS Score
0.5%
Top 62% exploitable
Prevalence
Medium
popular lightweight embeddable JS engine, niche versus V8/Node runtimes
Exploit
POC
Public exploit code exists
Data Quality
2 sources
Confidence: Low

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.5%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Controlled
Automatable· derived
No
Human Impact
High

Priority Score

56
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.

Affected Products (CPE)CVE.org

cpe:2.3:a:quickjs_project:quickjs:*:*:*:*:*:*:*:*
CVE-2025-62491 HIGH POC
8.8 Oct 16

A use-after-free in QuickJS's quickjs-libc standard library lets JavaScript code corrupt heap memory from inside the int

CVE-2025-62490 HIGH POC
8.8 Oct 16

Use-after-free in QuickJS object-printing routines can corrupt memory when an attacker-influenced Array, Map, or Set is

CVE-2023-31922 HIGH POC
7.5 May 12

QuickJS commit 2788d71 was discovered to contain a stack-overflow via the component js_proxy_isArray at quickjs.c. Rated

CVE-2025-62496 HIGH POC
7.1 Oct 16

Heap out-of-bounds write in QuickJS's BigInt string parser can corrupt memory when an embedding application converts an

CVE-2025-62494 HIGH POC
7.1 Oct 16

Type confusion in QuickJS's handling of the string addition (+) operation allows local attackers to trigger out-of-bound

CVE-2025-62492 MEDIUM POC
5.9 Oct 16

Information disclosure in QuickJS occurs through a floating-point precision error in TypedArray.prototype.indexOf() when

CVE-2025-62493 MEDIUM POC
5.9 Oct 16

An out-of-bounds heap read in QuickJS's BigInt-to-string conversion (js_bigint_to_string1) lets script-controlled BigInt

CVE-2026-88378 CRITICAL
9.8 Sep 24

Heap out-of-bounds write in QuickJS's bytecode deserializer (JS_ReadFunctionTag) lets a crafted serialized blob corrupt

CVE-2025-46687 MEDIUM POC
5.6 Apr 27

quickjs-ng through 0.9.0 has a missing length check in JS_ReadString for a string, leading to a heap-based buffer overfl

CVE-2025-46688 MEDIUM POC
5.6 Apr 27

quickjs-ng through 0.9.0 has an incorrect size calculation in JS_ReadBigInt for a BigInt, leading to a heap-based buffer

CVE-2026-0821 MEDIUM POC
5.5 Jan 10

Heap-based buffer overflow in QuickJS up to version 0.11.0 within the js_typed_array_constructor function allows unauthe

CVE-2024-13903 MEDIUM POC
5.3 Mar 21

A vulnerability was found in quickjs-ng QuickJS up to 0.8.0. Rated medium severity (CVSS 5.3), this vulnerability is rem

References

Advisories & patches

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy