Executive brief
A vulnerability in the re2 regular expression library for Node.js can cause an application to crash unexpectedly when processing certain text. This occurs when an attacker provides a specific starting position for a search on text containing non-standard characters (like emojis or non-English scripts). Because the crash happens at a deep system level, standard error handling cannot prevent the entire service from shutting down, potentially leading to a denial of service.
Technical details
The vulnerability exists in the `StrVal::setIndex` and `getUtf16PositionByCounter` functions within `lib/addon.cc` and `lib/wrapped_re2.h`. The library validates the user-supplied `lastIndex` against the UTF-8 byte length of the subject string but subsequently treats that index as a UTF-16 code-unit count when walking the buffer. For non-ASCII subjects where byte length exceeds character count, an attacker can set `lastIndex` to a value that passes validation but points beyond the allocated buffer. This results in an out-of-bounds read that can cause a segmentation fault (DoS) or, in some cases, leak adjacent heap memory into the return value. The issue affects `exec`, `test`, `match`, `replace`, and `split` operations. Fixed in version 1.25.2.
Affected products
- uhop re2 (npm) <= 1.25.1
Timeline
- 2026-07-07: patched: Fixed in version 1.25.2
- 2026-07-30: advisory: NVD published CVE-2026-67550
- 2026-07-31: disclosed: GitHub Advisory published