CVE-2025-62495
published high CVSS 4.0 · 7.1Type confusion in string addition in QuickJS
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| QuickJS | — | libregexpQuickJS · 2025-04-26 to < 2025-09-13 · Other versions: unaffected | Affected | Not stated |
Description
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);
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 7.1 / 10
- Severity
- high
- Provider
- Google · cna
- Vector string
- 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
- Scenarios
- en: GENERAL
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| QuickJS | QuickJS | 2025-04-26 to < 2025-09-13 (affected · date)Default: unaffected | Google · cna |
Weaknesses
1- CWE-191 CWE-191 Integer Underflow (Wrap or Wraparound)
References
2Provider assertions
2Google · cna
Type confusion in string addition in QuickJS
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 7b0a76c369166d6f16c23101d9312b57197957eef62e4076261a381db4a67326
- Ingested
- 23 Sep 2026, 08:55:28 UTC
- Source record
- Official CVE record