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.
- 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.
- Last modified
- FIRST's estimate of the chance attackers exploit it in the next 30 days, updated daily.What do these mean? →
- 0.35% · 28th percentile
- A 0-100 score for how much a CVE matters across the industry: exploitation, exposure, how widely the software is used, severity and whether a fix exists.What do these mean? →
- 43/100 · provisional
- How many real-world setups can hit the bug, from the vendor's advisory and CISA data. It does not know your setup.What do these mean? →
- Unclear
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- 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
- 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
- CVE published
- First seen by cve.now
- CISA SSVC assessment
Exploitation: poc · Automatable: yes · Technical impact: partial
- Record last updated
Affected versions
- dlclark regexp2
fixed in 2.3.0
Evidence 3
- Advisory
- Repository
- 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