Skip to main content
← Vulnerabilities

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

Affects the regexp2 Go package below 2.3.0 when a pattern applies a large fixed-count quantifier to a zero-width subexpression. Fixed in 2.3.0.

Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.

7.5HighCNA
Exploited
Proof of concept public, per CISA
Fix
Fixed in 2.3.0
Who is exposed
Not reported

Do first: Upgrade to a fixed version: 2.3.0.

Published
Last modified
0.35% · 28th percentile
43/100 · provisional
Unclear
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: poc
  • Automatable: yes
  • Technical impact: partial

Summary

Regexp2, a regular expression engine for Go, can be made to consume huge amounts of memory by a crafted pattern containing a large fixed-count quantifier on an empty subexpression, causing denial of service when the process runs out of memory. The flaw can be reached remotely, without logging in, and it is fixed in a later release.

Read the original 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.

cve.now Index

43Pcve.now Index 43 of 100 · methodology v3 · provisional
  • Exploitation15/40CISA rates a proof of concept as public
  • Exposure20/25No login or user action needed, CISA rates it automatable · Unknown: Advisories don't say whether default setups are affected
  • Reach?/20Unknown. No tracked technology or package matched
  • Severity7.5/10CVSS 7.5
  • No patch0/5No signal

What would change the score

  • Would score about 73 if added to CISA KEV
  • Would score about 68 if CISA's SSVC rates exploitation active
  • Would score about 48 if advisories confirm default setups are exposed

What to do

  • Upgrade to a fixed version: 2.3.0.

Timeline

  1. CVE published
  2. First seen by cve.now
  3. CISA SSVC assessment

    Exploitation: poc · Automatable: yes · Technical impact: partial

  4. Record last updated

Affected versions

  • dlclark regexp2

    fixed in 2.3.0

Evidence 3

  1. Advisory
  2. Repository
  3. Repository

Corrections

None so far.

Something wrong on this page? Report an error. Every fix is listed here.

Questions about CVE-2026-77299

Is CVE-2026-77299 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. CISA's SSVC assessment notes a proof of concept exists. No public exploit code is tracked.Source: cve.now feed data

What does this mean?

A pattern with a very large fixed repeat count applied to a group that matches no characters, such as (?:){50000000}, can make the library allocate multi-gigabyte memory. That can run the process out of memory and kill it.Source: github.com

Which versions are affected by CVE-2026-77299?

regexp2: before 2.3.0.Source: cve.now feed data

Am I affected, and how do I check?

Versions of the regexp2 Go package below 2.3.0 are affected, but only when a pattern contains a large fixed-count quantifier on a zero-width subexpression. To check, look at the regexp2 version in your go.mod file or run go list -m github.com/dlclark/regexp2.Source: github.com

How do I fix CVE-2026-77299?

Upgrade the regexp2 Go package to 2.3.0 or later, which contains the fix.Source: github.com