Description
Gitea versions before 1.26.0 do not fail closed on bufio.Scanner errors while processing pre-receive hook input, allowing oversized input to bypass branch-protection checks.
Published: 2026-07-03
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability arises when the pre‑receive hook in Gitea reads push data with a bufio.Scanner. On encountering a scanning error, often caused by an oversized payload, the hook exits early without performing branch‑protection checks. The result is that a push that would normally be rejected can be accepted, allowing an attacker with push rights to inject malicious code into protected branches. The weakness is classified as CWE‑863: Failure to Consider All Exhaustive or Alternate Conditions. This effectively compromises the integrity of protected repositories.

Affected Systems

The vulnerability affects the open‑source Gitea Git server. All releases earlier than 1.26.0 are impacted. In versions before 1.26.0, the hook uses a bufio.Scanner to read the push data. If the scanner encounters an error—often caused by an oversized payload—the hook exits without performing the branch‑protection checks. This flaw allows a push that would normally be blocked to be accepted, effectively compromising the integrity of protected branches.

Risk and Exploitability

The CVSS score of 9.8 denotes a critical severity, yet the EPSS score of less than 1% indicates that exploitation is not currently prevalent. The vulnerability is not listed in the CISA KEV catalog. Based on the description, it is inferred that an attacker must have push access to a repository to trigger the flaw. Once the hook bypasses branch‑protection, any commits created by the attacker will be accepted, potentially introducing malicious code into protected branches.

Generated by OpenCVE AI on July 21, 2026 at 09:29 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Gitea to version 1.26.0 or later, which includes a patch that enforces proper failure handling for scanner errors in the pre‑receive hook. Limit the size of data accepted by pre‑receive hooks or enforce repository size quotas to reduce the chance of oversized payloads.
  • Restrict push permissions to trusted users or groups, reducing the number of actors that can trigger the vulnerable hook.
  • Configure your reverse proxy or load balancer to limit HTTP request sizes, preventing oversized pre‑receive payloads from reaching Gitea.

Generated by OpenCVE AI on July 21, 2026 at 09:29 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 06 Jul 2026 23:15:00 +0000

Type Values Removed Values Added
First Time appeared Gitea
Gitea gitea Open Source Git Server
Vendors & Products Gitea
Gitea gitea Open Source Git Server

Mon, 06 Jul 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Fri, 03 Jul 2026 20:45:00 +0000

Type Values Removed Values Added
Description Gitea versions before 1.26.0 do not fail closed on bufio.Scanner errors while processing pre-receive hook input, allowing oversized input to bypass branch-protection checks.
Title Gitea pre-receive hook can miss branch-protection checks after scanner errors
Weaknesses CWE-863
References

Subscriptions

Gitea Gitea Open Source Git Server
cve-icon MITRE

Status: PUBLISHED

Assigner: Gitea

Published:

Updated: 2026-07-06T15:20:06.013Z

Reserved: 2026-03-03T03:25:28.724Z

Link: CVE-2026-27780

cve-icon Vulnrichment

Updated: 2026-07-06T15:19:54.650Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-21T09:30:04Z

Weaknesses