Skip to main content
Vulnerability Database/CVE-2026-87720

CVE-2026-87720: Gerrit Code Review Information Disclosure

CVE-2026-87720 is an information disclosure flaw in Gerrit Code Review affecting versions 2.16.0-3.12.9, 3.13.0-3.13.8, and 3.14.0-3.14.2. The vulnerability enables unauthorized access to private repositories. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

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-87720 Overview

CVE-2026-87720 is an Incorrect Authorization vulnerability [CWE-863] in Gerrit Code Review affecting the project name normalization logic in ProjectUtil.stripGitSuffix and the eviction logic in ProjectCacheImpl. The flaw allows an authenticated user, or an unauthenticated user when a repository was previously public, to access private repository content and restore revoked owner privileges. Attackers craft requests using repeated .git suffixes such as project.git.git across REST APIs, Gitiles, or SSH Git commands. The vulnerability affects Gerrit Code Review versions 2.16.0 through 3.12.9, 3.13.0 through 3.13.8, and 3.14.0 through 3.14.2.

Critical Impact

Unauthorized disclosure of private repository content and durable restoration of revoked project-owner administrative privileges, including the ability to write to refs/meta/config.

Affected Products

  • Gerrit Code Review 2.16.0 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-87720 published to NVD
  • 2026-09-25 - Last updated in NVD database

Technical Details for CVE-2026-87720

Vulnerability Analysis

The vulnerability stems from an inconsistency between how Gerrit normalizes project names and how JGit resolves repository paths on disk. Gerrit's ProjectUtil.stripGitSuffix removes only a single trailing .git suffix when constructing the logical ProjectCache key. JGit's FileKey.lenient resolver, by contrast, resolves suffixed aliases such as project.git.git to the same canonical bare repository on disk.

This mismatch creates distinct cache entries for what is physically the same repository. When an administrator revokes read access or removes owner rules on the canonical project name, the cached alias ProjectState is not evicted during the cache validity window. The stale cache entry retains the previous permissions, allowing continued reads of newly created private commits and writes to refs/meta/config.

Root Cause

The root cause is asymmetric normalization between Gerrit's authorization layer and JGit's filesystem resolver. Gerrit treats project and project.git.git as different cache keys while JGit maps both to the same canonical bare repository. Cache eviction operations target only the canonical key, leaving aliased entries with pre-revocation permissions valid in memory.

Attack Vector

An attacker issues requests to Gerrit using a project name with repeated .git suffixes via REST APIs, the Gitiles web interface, or SSH Git commands. If the repository was previously public or the attacker previously held owner rights, the cached alias ProjectState continues to grant access after revocation. The attacker can read private commits made after revocation and modify refs/meta/config to restore owner privileges durably. See the Gerrit Code Review Issue #538883789 for full technical details.

Detection Methods for CVE-2026-87720

Indicators of Compromise

  • Access log entries containing project references with repeated .git suffixes such as project.git.git or deeper variants across REST, Gitiles, or SSH endpoints.
  • Successful read or write operations on projects by users whose permissions were recently revoked.
  • Unexpected modifications to refs/meta/config restoring previously removed owner rules.

Detection Strategies

  • Audit Gerrit HTTP, SSH, and Gitiles access logs for request paths matching the pattern .*\.git\.git(\.git)* and correlate with the requesting user's current access.
  • Compare ProjectCache entries against the canonical project list to identify aliased cache keys retaining stale permissions.
  • Monitor Git ref updates on refs/meta/config for all projects and alert on changes authored by users without current owner rights.

Monitoring Recommendations

  • Enable verbose audit logging on Gerrit REST API, SSH, and Gitiles front ends and forward events to a centralized SIEM for pattern analysis.
  • Track access events against time-ordered permission change records to detect read or write activity following revocation.
  • Review account-group membership changes and refs/meta/config commits during the exposure window.

How to Mitigate CVE-2026-87720

Immediate Actions Required

  • Upgrade Gerrit Code Review to version 3.12.10, 3.13.9, or 3.14.3 depending on your deployed branch.
  • Flush the ProjectCache after upgrading to invalidate any stale alias entries carried through the restart.
  • Review refs/meta/config history on all projects for unauthorized modifications performed during the exposure window.

Patch Information

The vulnerability is fixed in Gerrit Code Review versions 3.12.10, 3.13.9, and 3.14.3. Patched builds normalize repeated .git suffixes consistently with JGit's FileKey.lenient resolver so that cache keys and eviction operations apply to the canonical project name. Refer to Gerrit Code Review Issue #538883789 for upstream patch details.

Workarounds

  • Restrict access to Gerrit's REST, SSH, and Gitiles endpoints at the network edge until patches are applied where feasible.
  • Restart the Gerrit service after any permission revocation to force eviction of cached alias ProjectState entries.
  • Add a reverse-proxy rule to reject request paths containing multiple consecutive .git suffixes.
bash
# Example nginx rule to block repeated .git suffixes in project paths
location ~* "\.git\.git(\.git)*(/|$)" {
    return 400;
}

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.