Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-87722 Overview
CVE-2026-87722 is an uncontrolled resource consumption vulnerability [CWE-400 / CWE-1333] in Gerrit Code Review. The flaw resides in regex search query predicates such as RegexProjectPredicate, RegexRefPredicate, and RegexPathPredicate, along with REST regex filter endpoints /projects/?r= and /projects/{project}/branches/?r=. An unauthenticated remote attacker can submit crafted regular expressions that trigger catastrophic automaton compilation, exhausting JVM heap or pinning request threads. The issue affects Gerrit versions 2.1.6 through 3.12.9, 3.13.0 through 3.13.8, and 3.14.0 through 3.14.2. Patched releases are 3.12.10, 3.13.9, and 3.14.3.
Critical Impact
A single crafted HTTP request can trigger OutOfMemoryError or sustained CPU starvation on the Gerrit JVM, denying service to all users regardless of heap size.
Affected Products
- Gerrit Code Review 2.1.6 through 3.12.9
- Gerrit Code Review 3.13.0 through 3.13.8
- Gerrit Code Review 3.14.0 through 3.14.2
Discovery Timeline
- 2026-09-24 - CVE-2026-87722 published to NVD
- 2026-09-25 - Last updated in NVD database
Technical Details for CVE-2026-87722
Vulnerability Analysis
Gerrit exposes several search predicates and REST endpoints that accept user-supplied regular expressions. These include RegexProjectPredicate, RegexRefPredicate, RegexPathPredicate, the RegexListSearcher endpoint at /projects/?r=, and the RefFilter endpoint at /projects/{project}/branches/?r=. When a request arrives, Gerrit compiles the regex into a dk.brics.automaton instance via new RegExp(re).toAutomaton().
This compilation happens on the request-handling thread before index evaluation or access control filtering. The automaton library performs DFA determinization, which can grow exponentially for certain patterns. Large counted repetitions or exponential-blowup patterns produce automata that consume multi-gigabyte heap allocations or run indefinitely.
Because compilation precedes authorization checks, the attack works even when anonymous read access is enabled. When anonymous access is disabled, any authenticated low-privilege user can still trigger the condition.
Root Cause
The root cause is the absence of bounds on regex complexity and automaton state count. Gerrit passes untrusted input directly to dk.brics.automaton, which lacks guardrails against pathological patterns. No timeout, no state-count ceiling, and no complexity analysis is applied before compilation begins.
Attack Vector
The attack vector is a network-reachable HTTP request to a regex-accepting search endpoint or REST filter. The attacker crafts a query string containing a regular expression with large counted repetitions (for example, a{1,1000000}) or a pattern that forces exponential DFA state explosion during determinization. Repeated requests amplify the denial-of-service condition into sustained outage.
The vulnerability is described in prose only; see the Gerrit Code Review Issue #540877705 for additional technical details.
Detection Methods for CVE-2026-87722
Indicators of Compromise
- HTTP requests to /projects/?r= or /projects/{project}/branches/?r= containing regex expressions with large counted quantifiers or nested alternations.
- Gerrit JVM logs reporting java.lang.OutOfMemoryError: Java heap space or GC overhead limit exceeded shortly after regex-bearing requests.
- Sudden spikes in Gerrit request-thread CPU utilization correlated with search or branch filter queries.
- Request latency outliers on endpoints that accept the r= query parameter.
Detection Strategies
- Parse Gerrit HTTP access logs for query strings matching regex patterns longer than a defined threshold or containing counted repetitions above a safe bound.
- Alert on JVM heap exhaustion events and thread-pool saturation in Gerrit application metrics.
- Correlate client IP addresses submitting repeated regex-heavy queries to detect scripted abuse.
Monitoring Recommendations
- Enable JVM garbage collection logging and ship it to a centralized SIEM for anomaly detection.
- Monitor Gerrit httpd request thread pool utilization and queue depth continuously.
- Track request rate per source IP on regex-accepting endpoints and establish baselines for alerting.
How to Mitigate CVE-2026-87722
Immediate Actions Required
- Upgrade Gerrit Code Review to version 3.12.10, 3.13.9, or 3.14.3 depending on your branch.
- Place Gerrit behind a reverse proxy or WAF that rejects suspiciously long or complex regex query parameters until patching completes.
- Restrict anonymous read access where operationally feasible to limit the unauthenticated attack surface.
- Review HTTP access logs for prior exploitation attempts targeting the r= parameter.
Patch Information
Gerrit Code Review has released fixed versions 3.12.10, 3.13.9, and 3.14.3. These releases bound regex compilation to prevent heap exhaustion and thread starvation. Consult the Gerrit Code Review Issue #540877705 for upstream fix details and release notes.
Workarounds
- Configure a reverse proxy rule to reject requests whose r= parameter exceeds a conservative length limit (for example, 256 characters).
- Block or rate-limit regex-bearing requests from unauthenticated clients at the network edge.
- Lower the Gerrit httpd.maxThreads setting is not a remediation; apply the patch instead to avoid service degradation.
# Example nginx rule to reject oversized regex query parameters
location /projects/ {
if ($arg_r ~* ".{256,}") {
return 400;
}
proxy_pass http://gerrit_backend;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

