# CVE-2025-62495: Type confusion in string addition in QuickJS

- Severity: High 7.1 (CVSS:4.0, scored by Google) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.47%, higher than 42% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-10-16T15:51:58.953Z
- Modified: 2026-10-19T16:10:00.260Z
- Weaknesses: CWE-191
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: Google

## 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);

(As written by CVE List.)

## Affected

- libregexp: from 2025-04-26 before 2025-09-13
- quickjs_project quickjs: before 2025-09-13

## Every score

- Google: CVSS:4.0 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`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://issuetracker.google.com/434196926> (exploit, issue-tracking)
- <https://bellard.org/quickjs/Changelog> (release-notes)

## Sources

- CVE List: [CVE-2025-62495](https://www.cve.org/CVERecord?id=CVE-2025-62495), CVE Terms of Use, modified 2025-10-16
- NVD: [CVE-2025-62495](https://nvd.nist.gov/vuln/detail/CVE-2025-62495), Public domain, modified 2026-10-19

---

Page: https://cve.day/CVE-2025-62495 · Whole record: https://cve.day/CVE-2025-62495.json · Rebuilt by cve.day 2026-11-25T22:59:06.498Z
