CVE-2026-77299 · Package
NO FIX YET · SEE WHAT TO DO
Regexp2, a RegExp engine for Go, lets a pattern under 20 bytes with a huge repeat count on an empty group make the matcher allocate gigabytes of memory. An attacker who can supply the pattern can crash the process by running out of memory.
first public Jul 11, 2026 · 1 source
Check it with your coding agent
It checks your repository and tells you if you’re affected, with the fix.
Applications that compile or match regular expressions written by untrusted users with regexp2 before version 2.3.0. Programs that only use fixed, developer-written patterns are much less exposed. MatchTimeout does not prevent this, so it is not a workaround.
Not affected if fixed-patterns-only, regexp2-2.3.0-or-later
Who cares go, regexp2, user-supplied-patterns
github.com/dlclark/regexp2 in go.mod or go list -m github.com/dlclark/regexp2github.com/dlclark/regexp2 version 2.3.0Regexp2 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.
Are you affected?
Tell InfraStack what you run. It checks this one, and every next one, against your stack.
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.