QuickJS
CVE-2025-62495
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit script/regex to QuickJS host
-
DeliveryCompile recursive pattern exceeding 2GB bytecode
-
Exploitsize_t truncated to negative signed int
-
ExecutionNegative offset drives out-of-bounds put_u32 write
-
ImpactCorrupt 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
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).
Primary rating from Vendor (google).
CVSS VectorVendor: google
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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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
A use-after-free in QuickJS's quickjs-libc standard library lets JavaScript code corrupt heap memory from inside the int
Use-after-free in QuickJS object-printing routines can corrupt memory when an attacker-influenced Array, Map, or Set is
QuickJS commit 2788d71 was discovered to contain a stack-overflow via the component js_proxy_isArray at quickjs.c. Rated
Heap out-of-bounds write in QuickJS's BigInt string parser can corrupt memory when an embedding application converts an
Type confusion in QuickJS's handling of the string addition (+) operation allows local attackers to trigger out-of-bound
Information disclosure in QuickJS occurs through a floating-point precision error in TypedArray.prototype.indexOf() when
An out-of-bounds heap read in QuickJS's BigInt-to-string conversion (js_bigint_to_string1) lets script-controlled BigInt
Heap out-of-bounds write in QuickJS's bytecode deserializer (JS_ReadFunctionTag) lets a crafted serialized blob corrupt
quickjs-ng through 0.9.0 has a missing length check in JS_ReadString for a string, leading to a heap-based buffer overfl
quickjs-ng through 0.9.0 has an incorrect size calculation in JS_ReadBigInt for a BigInt, leading to a heap-based buffer
Heap-based buffer overflow in QuickJS up to version 0.11.0 within the js_typed_array_constructor function allows unauthe
A vulnerability was found in quickjs-ng QuickJS up to 0.8.0. Rated medium severity (CVSS 5.3), this vulnerability is rem
NVD
CVE.org
EPSS
GitHub PoC
Exploit-DB