RE2JS
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 2.2.0, < 2.8.7
Fixed in 2.8.7
Mitigation
Upgrade re2js to 2.8.7 or later.
References
- Vendor advisory github.com/le0pard/re2js/security/advisories/G…
- Patch github.com/le0pard/re2js/pull/59
- Patch github.com/le0pard/re2js/commit/dfdd947785dfa1…
1 more
- Release notes github.com/le0pard/re2js/releases/tag/2.8.7
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.