CVE-2026-116795

RE2JS: Quadratic-time denial of service in re2js lookbehind matching

Published Oct 28, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability resides in the Re2JS regular expression engine, a JavaScript port of the RE2 library. From version 2.2.0 through 2.8.6, enabling lookbehind constructs and performing repeated matching operations such as matcher().find(), matchAll(), split(), or matcher().replaceAll() can trigger quadratic total processing time. The underlying issue lies in how the engine restarts lookbehind scanning from the beginning for each start position, and in matcher-based APIs that request capture slots, which block early exit optimizations used for captureless patterns. Dense matches therefore repeatedly rescan large portions of the input, allowing maliciously crafted text to monopolize a single‑threaded worker and cause a denial of service. The weakness is an instance of CWE-1333 (Improper Limitation of Input Size) and CWE-407 (Uncontrolled Resource Consumption).

Affected Systems

Affected vendor and product: le0pard re2js. Versions affected include all releases from 2.2.0 up to but excluding 2.8.7, the first version to contain the fix. This impacts any software that incorporates the unpatched Re2JS library, especially web applications and services that interpret user input through the matcher APIs.

Risk and Exploitability

The CVSS base score of 7.5 reflects a high impact denial of service with medium to high exploitation potential. EPSS is not available, and the vulnerability is not listed in CISA’s KEV catalogue. Because the flaw is exercised when user-controllable data is fed to the regex engine, the attack vector is inferred to be remote, via any API endpoint that processes user input. An attacker needs only to send a crafted request containing a dense lookbehind pattern and malicious text; no additional privileges are required. The single‑threaded execution model means a single successful request can drain processor time, causing application unavailability until the request completes or the server is restarted.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade le0pard re2js to version 2.8.7 or later.
  • Disable lookbehind support in re2js if it is not required by your application logic.
  • Limit the size of input strings processed by re2js to reduce the impact of dense lookbehind matches.

Generated by OpenCVE AI on October 28, 2026 at 18:40 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-gg6h-894w-4m9c RE2JS: Quadratic-time denial of service in re2js lookbehind matching
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Le0pard
Le0pard re2js
Vendors & Products Le0pard
Le0pard re2js
Type Values Removed Values Added
Description 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.
Title RE2JS: Quadratic-time denial of service in re2js lookbehind matching
Weaknesses CWE-1333
CWE-407
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

Weaknesses
  • CWE-1333

    Inefficient Regular Expression Complexity

  • CWE-407

    Inefficient Algorithmic Complexity

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 2, 2026, 8:21 PM
Reserved
Oct 26, 2026, 9:53 PM
Status
Awaiting Analysis
Published
Oct 28, 2026, 6:17 PM
Modified
Nov 2, 2026, 9:17 PM
Severity
Important
Public date
Oct 28, 2026, 5:14 PM