Description
re2 provides Node.js bindings for Google's RE2 regular expression engine. Prior to 1.25.2, re2 validates lastIndex against the UTF-8 byte length of a subject but uses it as a UTF-16 code-unit offset in exec, test, match, replace, and split, allowing an attacker-influenced lastIndex on a non-ASCII subject to trigger an out-of-bounds heap read and an uncatchable process crash, with limited heap information disclosure in some cases. This issue is fixed in 1.25.2.
Severity (CVSS)
| Base score | 5.7 |
|---|---|
| Severity | Medium |
| Version | CVSS 3.1 |
| Vector | CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:H |
| Provided by | CNA |
Weaknesses
- CWE-125 — CWE-125: Out-of-bounds Read
Affected products
| Vendor | Product | Versions |
|---|---|---|
| uhop | node-re2 | < 1.25.2 |
References
- https://github.com/uhop/node-re2/security/advisories/GHSA-ff84-5f28-78qj (x_refsource_CONFIRM)
- https://github.com/uhop/node-re2/commit/56293de4fc0914d7bc35f92e98de25b0d9bb417d (x_refsource_MISC)
- https://github.com/uhop/node-re2/releases/tag/1.25.2 (x_refsource_MISC)
Generated from the official CVE List on 31 Jul 2026 07:05 UTC.