Vulnerabilities

Security research · CVE-2026-116795

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

Published Oct 28, 2026 · catalog updated Oct 28, 2026 · RE2JS: Quadratic-time denial of

Last checked Nov 4, 2026. A connected source was read within the last 7 days.

Check if you run it

No confirmed exploitation is on record for CVE-2026-116795. EPSS is 0.46%. Act only if a listed version of RE2JS: Quadratic-time denial of is installed.

Gaps on this record

  • The stored product name is a package slug. The name on this page is taken from the title (RE2JS: Quadratic-time denial of).
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.
Severity
High7.5
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.46%
Remediation
Version ranges on file
Affected products
npm re2js

### Summary Using the opt-in flag together with any repeated-matching API ( in a loop, , , ) causes quadratic-time (Θ(n²)) matching, contradicting the library's own "linear time matching" guarantee. A single call with a 16,000-character input takes **36.7–38.7 seconds of CPU**. ### Description #### Root cause In , : Any pattern containing a lookbehind sets , which forces the scan to **always restart at offset 0**, regardless of the requested start position — the lookbehind automaton is re-seeded and the whole input is re-walked on every single call. The early-exit optimization that would otherwise stop at the first match only fires when , but every -based API ( / / / ) always requests (one capture group slot) **even for a captureless lookbehind pattern** — so the early exit never triggers through those APIs, and the scan continues to the end of the input on every find. A find-loop over *k* matches in an *n*-character string therefore costs *k* × Θ(*n*); for dense matches *k* ∝ *n*, giving **Θ(n²)** total. #### Isolating control Identical find-loop, identical input sizes, same 2-character literal pattern *shape* — but **without** the flag: | n | with (lookbehind pattern) | without (plain literal) | native JS lookbehind | |---|---|---|---| | 2,000 | 204–228 ms | 3 ms | 0 ms | | 4,000 | 877–899 ms | 4 ms | 0 ms | | 8,000 | 5,746–6,599 ms | 7 ms | 1 ms | | 16,000 | 36,667–38,732 ms | 6 ms | 1 ms | This isolates the lookbehind machinery itself — not pattern length, not match density in the abstract — as the exact and sole cause. #### Impact - 's entire value proposition is being an RE2-style engine with **linear-time, no-backtracking** matching, specifically to resist algorithmic-complexity attacks that plague backtracking regex engines. This finding defeats that guarantee for any consumer using the advertised feature. - Realistic affected code paths: log/text processing that tokenizes or redacts using a lookbehind-based pattern ( , , are the natural APIs for exactly thi

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • npm re2js>= 2.2.0, < 2.8.7

How to fix CVE-2026-116795

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2026-116795. EPSS is 0.46%. Act only if a listed version of RE2JS: Quadratic-time denial of is installed.

Which versions are affected?

Compare what you have installed with >= 2.2.0, < 2.8.7. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-1333: Inefficient Regular Expression Complexity; CWE-407. EPSS 0.46%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Oct 28, 2026 · GitHub Advisory Database

    Detected

    ### Summary Using the opt-in flag together with any repeated-matching API ( in a loop, , , ) causes quadratic-time (Θ(n²)) matching, contradicting the library's own "linear time matching" guarantee. A single call with a 16,000-character input takes **36.7–38.7 seconds of CPU**. ### Description #### Root cause In , : Any pattern containing a lookbehind sets , which forces the scan to **always resta

  2. Oct 28, 2026 · GitHub Advisory Database

    Updated

    ### Summary Using the opt-in flag together with any repeated-matching API ( in a loop, , , ) causes quadratic-time (Θ(n²)) matching, contradicting the library's own "linear time matching" guarantee. A single call with a 16,000-character input takes **36.7–38.7 seconds of CPU**. ### Description #### Root cause In , : Any pattern containing a lookbehind sets , which forces the scan to **always resta

Sources

  • CVE.orgVulnerability recordCVE-2026-116795

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2026-116795

    30-day exploitation probability 0.46%

    first.org
  • GitHub Advisory DatabasePackage advisoryGHSA-gg6h-894w-4m9c

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

    github.com
  • GitLab Advisory DatabasePackage advisoryCVE-2026-116795

    Using the opt-in LOOKBEHINDS flag together with any repeated-matching API (matcher().find() in a loop, matchAll(), split(), matcher().replaceAll()) causes quadratic-time (Θ(n²)) matching, contradicting the library's own "linear time matching" guarantee. A single call with a 16,000-character input takes 36.7–38.7 seconds of CPU.

    advisories.gitlab.com

References

Freshness

Last verified in this catalog Nov 4, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.

  • FIRST EPSSNov 4, 2026
  • CVE.orgOct 29, 2026
  • GitLab Advisory DatabaseOct 29, 2026
  • GitHub Advisory DatabaseOct 29, 2026