CVE-2026-116795
RE2JS: Quadratic-time denial of service in re2js lookbehind matching
RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching. From 2.2.0 until 2.8.7, enabling LOOKBEHINDS and using repeated matching through matcher().find(), matchAll(), split(), or matcher().replaceAll() can cause quadratic total work. Machine.match restarts lookbehind scanning from offset zero for each requested start position, while Matcher-based APIs request capture slots that prevent the early exit used for captureless matching. Dense matches therefore repeatedly rescan the input, allowing attacker-influenced text to monopolize a single-threaded worker and deny service. This issue is fixed in version 2.8.7.
Fixes and workarounds
Fix
re2js (npm): OSV reports a fixed version 2.8.7. Check the advisory for supported release branches.
Source: OSV GHSA-gg6h-894w-4m9cAffected products and versions
| Product | Versions | Authority |
|---|---|---|
| re2js le0pard |
>= 2.2.0, < 2.8.7 (affected) | CNA: GitHub_M |
re2jsre2js
npm |
≥ 2.2.0; < 2.8.7 (affected, semver); OSV events: introduced 2.2.0; fixed 2.8.7Source events (semver)
Other versions: unaffected |
OSV GHSA-gg6h-894w-4m9c |
Version ranges are source assertions. Check the vendor advisory and your installed configuration before determining exposure.
CVSS assessments
| Version / score | Vector | Authority |
|---|---|---|
| 3.1 / 7.5 high |
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | CNA: GitHub_M |
Exploit evidence
- https://github.com/le0pard/re2js/security/advisories/GHSA-gg6h-894w-4m9c
exploit · ADP: CISA-ADP
References
- https://github.com/le0pard/re2js/security/advisories/GHSA-gg6h-894w-4m9cCNA: GitHub_M · x_refsource_CONFIRM
- https://github.com/le0pard/re2js/pull/59CNA: GitHub_M · x_refsource_MISC
- https://github.com/le0pard/re2js/commit/dfdd947785dfa113bdc97416375c246a39458395CNA: GitHub_M · x_refsource_MISC
- https://github.com/le0pard/re2js/releases/tag/2.8.7CNA: GitHub_M · x_refsource_MISC
- https://github.com/le0pard/re2js/security/advisories/GHSA-gg6h-894w-4m9cADP: CISA-ADP · exploit
- https://github.com/advisories/GHSA-gg6h-894w-4m9cOSV / GitHub Security Advisories · advisory
- https://osv.dev/vulnerability/GHSA-gg6h-894w-4m9cOSV / GitHub Security Advisories · osv
For agents and automation
Read public disclosures for free as Markdown or JSON. Compatible browsers also expose native WebMCP tools to search disclosures, read this page, and discover API access.
Use the ontology-linked Cyber API with x402 pay per request, or a Y2 Pro or Elite API key with the intel:cyber scope.
Endpoints and access details
https://api.y2.dev/api/v2/cyber/cveshttps://api.y2.dev/api/v2/cyber/cves/{cveId}
A workspace owner or admin can create a Pro or Elite API key. Send Authorization: Bearer <Y2_API_KEY> from your trusted agent runtime.
For x402, omit Authorization and read the HTTP 402 payment challenge before signing a retry. Public browser tools do not make payments.