CVE-2026-77299

Regexp2: Unbounded memory amplification via large `{m}` quantifier on a zero-width subexpression

Published Nov 6, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
Regexp2 is a feature-rich RegExp engine for Go. Prior to version 2.3.0, when regexp2 compiles and matches a pattern containing a large fixed-count quantifier applied to a zero-width subexpression — e.g. (?:){50000000} — the match engine executes the empty loop body m-1 times, pushing two integers onto the backtracking stack on every iteration. Because the parser accepts any repetition count up to math.MaxInt32 and the backtracking stack grows without bound, a pattern of fewer than 20 bytes matched against an empty input can force multi-gigabyte allocation and OOM-kill the process. MatchTimeout does not fully mitigate this because the memory is allocated faster than the 100 ms timeout clock can fire. This issue has been patched in version 2.3.0.

Analysis

AI-generated

Technical impact

Regexp2, a regex engine for Go, contains an unbounded memory amplification flaw. Patterns containing a large fixed‑count quantifier applied to a zero–width subexpression – for example (?:){50000000} – cause the engine to push millions of integers onto the back‑tracking stack. The memory grows until multi‑gigabyte allocations are required, which can lead to the process being OOM‑killed. The vulnerability is a classic case of uncontrolled resource consumption (CWE-400) and out‑of‑bounds memory access (CWE-770)."The impact is a local or remote denial of service if an attacker can supply such a pattern; the target application is brought down by exhausting available memory.

Affected Systems

The affected product is dlclark's Regexp2 library for Go. All versions prior to 2.3.0 are vulnerable. Version 2.3.0 and later include the fix. The issue was discovered in the commit 6e446cb3a57a0f20112bc24353604fd00bdb309a and is referenced in the 2.3.0 release notes.

Risk and Exploitability

The CVSS score of 7.5 indicates high severity. EPSS is not available, so the probability of exploitation is unknown; however, the failure occurs as soon as the offending pattern is compiled, so any application that accepts user‑supplied regexes can be impacted. KEV does not list this vulnerability, but that does not negate its risk. The attack path likely involves an attacker delivering a malicious regular expression to a component that compiles it with Regexp2, leading to a memory blow‑up and immediate process termination.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Regexp2 library to version 2.3.0 or newer.
  • Implement validation to reject patterns with extremely large quantifiers, e.g., limit repetition counts to a safe threshold.
  • Monitor application memory usage for unusual spikes and enforce process limits to mitigate denial of service impacts.

Generated by OpenCVE AI on November 6, 2026 at 02:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
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 Dlclark
Dlclark regexp2
Vendors & Products Dlclark
Dlclark regexp2
Type Values Removed Values Added
Description Regexp2 is a feature-rich RegExp engine for Go. Prior to version 2.3.0, when regexp2 compiles and matches a pattern containing a large fixed-count quantifier applied to a zero-width subexpression — e.g. (?:){50000000} — the match engine executes the empty loop body m-1 times, pushing two integers onto the backtracking stack on every iteration. Because the parser accepts any repetition count up to math.MaxInt32 and the backtracking stack grows without bound, a pattern of fewer than 20 bytes matched against an empty input can force multi-gigabyte allocation and OOM-kill the process. MatchTimeout does not fully mitigate this because the memory is allocated faster than the 100 ms timeout clock can fire. This issue has been patched in version 2.3.0.
Title Regexp2: Unbounded memory amplification via large `{m}` quantifier on a zero-width subexpression
Weaknesses CWE-400
CWE-770
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-400

    Uncontrolled Resource Consumption

  • CWE-770

    Allocation of Resources Without Limits or Throttling

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 6, 2026, 5:43 PM
Reserved
Aug 20, 2026, 7:17 PM
Status
Awaiting Analysis
Published
Nov 6, 2026, 2:17 AM
Modified
Nov 12, 2026, 10:18 PM
Severity
Important
Public date
Nov 6, 2026, 1:28 AM