Skip to main content

regexp2 EUVDEUVD-2026-117884

| CVE-2026-77299 HIGH
Uncontrolled Resource Consumption (CWE-400)
2026-11-06 GitHub_M
7.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit sub-20-byte crafted pattern to app
  2. Delivery
    App compiles pattern via regexp2
  3. Exploit
    Match runs empty loop body m-1 times
  4. Execution
    Backtracking stack grows without bound
  5. Persist
    Multi-gigabyte allocation outpaces MatchTimeout
  6. Impact
    Process OOM-killed (DoS)

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The affected application must compile a regexp2 pattern that is attacker-controlled or externally influenced - e.g. user-defined search filters, log-pipeline grok/extraction rules, routing/rewrite rules, or any *regexp2.Regexp struct field populated via encoding.TextUnmarshaler from untrusted JSON/YAML/TOML config - and the pattern must contain a large fixed-count quantifier (up to math.MaxInt32) applied to a zero-width subexpression, e.g. (?:){50000000}, (){m}, (?:\b){m}, or (?:|){m}. The haystack is NOT a prerequisite: the attack works against empty input, so attacker control of the match target is unnecessary. LIMITING FACTORS: applications that compile only hard-coded or trusted patterns and expose only the match input to attackers are explicitly unaffected. Setting MatchTimeout reduces but does not eliminate exposure because memory is allocated faster than the 100 ms clock tick can fire; the fix in 2.3.0 additionally bounds the backtracking stack (default 100,000 slots via OptionMaxBacktrackingStackSize, returning ErrBacktrackingStackLimit). Per the advisory, upgrading to 2.3.0 is the fix.

Impact

The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, base 7.5) scores this as a pure availability impact: a trivially exploitable, unauthenticated, network-reachable denial of service with no confidentiality or integrity consequence. No EPSS score and no SSVC decision values were supplied in the input, so exploitation-probability and automatable/technical-impact signals cannot be weighed here - that is a genuine gap. The CVE is NOT in CISA KEV (no active-exploitation signal), but the GHSA advisory ships a complete, self-contained Go reproducer with documented expected output (≈2.5 GiB from a 14-byte pattern; >60 GiB from an 18-byte pattern), so a working proof of concept is public. The vuln.today decision label is 'this_week' rather than act_now/emergency, which is consistent with a non-KEV, availability-only flaw whose exploitability is conditional. The decisive caveat - which tempers the AV:N/PR:N reading - is that exploitation requires the victim application to compile a regexp2 pattern that is attacker-influenced; the advisory explicitly states that applications compiling only hard-coded/trusted patterns and exposing only the match input are unaffected. So this is a real, prioritize-promptly issue for the specific class of Go services that accept untrusted regex patterns (search filters, log grok/extraction rules, routing/rewrite rules, config fields unmarshaled from JSON/YAML/TOML), but a low-real-risk item for the majority of deployments that never feed untrusted patterns into regexp2. EPSS being absent means widespread-vs-targeted exploitation likelihood cannot be judged from the data.

Exploit ScenarioDerived

A Go service exposes a feature that compiles a user-supplied regular expression with regexp2 - for example a log-pipeline extraction rule, a user-defined search filter, or a *regexp2.Regexp config field populated from untrusted JSON/YAML. An unauthenticated remote attacker submits a pattern under 20 bytes such as (?:){2000000000}, and matching it (even against empty input) drives the unbounded backtracking stack to multi-gigabyte allocation, OOM-killing the process. A full working reproducer is published in the GHSA advisory, demonstrating ~2.5 GiB allocated from a 14-byte pattern.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 06, 2026

Memory exhaustion denial of service in the Go regexp2 regular expression engine affects every release prior to 2.3.0 when an application compiles a pattern controlled or influenced by an attacker. A sub-20-byte pattern such as (?:){50000000} that applies a very large fixed-count quantifier to a zero-width subexpression causes the matcher to allocate hundreds of megabytes to tens of gigabytes while running against an empty input, OOM-killing the process; the upstream advisory reproduces roughly 2.5 GiB of allocation and ~3 seconds of CPU from a 14-byte pattern. Exploitation requires that the attacker control the pattern rather than the haystack, and applications that only compile hard-coded patterns are unaffected. The upstream advisory includes a public proof-of-concept; no CISA KEV entry or confirmed in-the-wild exploitation is indicated in the available data.

RemediationAI

Vendor-released patch: upgrade github.com/dlclark/regexp2 to v2.3.0 (release https://github.com/dlclark/regexp2/releases/tag/v2.3.0, fix commit 6e446cb3a57a0f20112bc24353604fd00bdb309a), which adds ErrBacktrackingStackLimit and caps the per-match backtracking stack at 100,000 integer slots by default, returning an error instead of allocating without bound; callers should surface that error rather than discarding it, and can test for it with errors.Is(err, regexp2.ErrBacktrackingStackLimit). Note that the compat adapter that mimics the stdlib signature panics on such errors, so paths using it need error handling around the call. Raising or disabling the limit via OptionMaxBacktrackingStackSize - a negative value restores unbounded growth and a value of 0 rejects nearly all interpreted matches with ErrBacktrackingStackLimit - reintroduces or over-tightens the exposure and should not be used as a substitute for the upgrade. On unpatched versions MatchTimeout is not a complete mitigation, since hundreds of MiB per concurrent match are still allocated and then retained in the runner cache before the 100 ms clock tick fires; the effective compensating control is architectural: restrict pattern input to trusted or allow-listed sources, validate and length/quantifier-cap untrusted patterns before compiling them, and avoid unmarshalling *regexp2.Regexp fields from untrusted configuration. Applications that only compile hard-coded patterns and expose just the match input to attackers are not affected per the advisory. Advisory: https://github.com/dlclark/regexp2/security/advisories/GHSA-wq9v-j77v-qr26.

Affected VersionsENISA

regexp2 < 2.3.0

Affected Packages

euvd regexp2 fix: 2.3.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

regexp2 is a .NET-style backtracking regular expression engine implemented in pure Go, used where Go's RE2-derived stdlib regexp is too limited (backreferences, lookarounds, atomic groups). The root cause is a missing bound on quantified repetition combined with unbounded growth of the interpreter's backtracking stack, classified as CWE-400 (Uncontrolled Resource Consumption) with CWE-770 (Allocation of Resources Without Limits or Throttling). In syntax/writer.go the bytecode emitter initialises a counted loop X{m,n} with Setcount 1-m, and the Branchcount handler in runner.go only short-circuits an empty-body iteration once the counter has climbed back to >= 0 (the guard 'matched == 0 && count >= 0'). Consequently the first m-1 iterations of a zero-width body all execute, and each one calls trackPush1, writing two ints to the runtack slice, which ensureStorage/doubleIntSlice grows by doubling with no ceiling and which is retained in the per-Regexp runner cache afterwards. The repetition count is parsed by scanDecimal, which accepts any value up to math.MaxInt32 with no separate cap on {m}. MatchTimeout is an incomplete control because checkTimeout reads a fastclock updated only every 100 ms (with makeDeadline padded an extra tick), so tens of millions of integer stores - hundreds of MiB - complete between clock ticks. Equivalent payload variants include (){m}, (?:\b){m} and (?:|){m}; the capturing form additionally inflates the crawl stack and capture arrays. The 2.3.0 fix introduces ErrBacktrackingStackLimit and a default per-match backtracking stack bound of 100,000 slots configurable via OptionMaxBacktrackingStackSize.

Know when Regexp2 gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 7.5 HIGH

For an app that accepts untrusted patterns the trigger is remote, trivial and unauthenticated (AV:N/AC:L/PR:N/UI:N); impact is availability-only (C:N/I:N/A:H) with no scope change.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Red Hat 7.5 HIGH

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

2
Patch available
Nov 06, 2026 - 02:01 EUVD
CVE Published
Nov 06, 2026 - 01:28 cve.org
HIGH 7.5

DescriptionCVE.org

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.

Technical POC Analysis

CWE-400 (Uncontrolled Resource Consumption), also tagged CWE-770 (Allocation of Resources Without Limits or Throttling).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

CVE-2026-77299 is a high-severity memory exhaustion flaw in the Go regexp2 library (versions before 2.3.0). Services that compile attacker-influenced regular expressions can be forced to allocate gigabytes of memory from a tiny pattern, causing process crashes and potential denial of service for dependent business services. Leadership should care because this can disrupt availability of customer-facing or internal systems that rely on Go regexp2 for pattern processing.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations include restricting or validating attacker-controlled regex patterns, enforcing strict pattern length and complexity limits, running regex compilation in isolated processes with memory limits, and adding timeouts to regex operations.

Threat Intelligence Overview

EPSS Score
0.3%
Top 72% exploitable
Prevalence
Medium
popular Go regex library for lookaround/backreference support, not universally deployed
Social Media
3
Sightings
Data Quality
7 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy