HIGH 8.8

CVE-2026-27775: Gitea 1.25.5 Permission Cache Privilege Escalation

Gitea 1.25.5 contains a privilege-escalation flaw in how it manages write permissions during git operations. When a user with limited write access to a specific branch executes a push, Gitea incorrectly caches their permission level and reuses it for all other branches and refs in the same operation. An attacker with per-branch maintainer permissions can exploit this to gain full repository write access, potentially modifying code, deleting branches, or corrupting the entire repository.

Source data · NVD / CISA · public domain

CVSS
3.1 · 8.8 HIGH · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weaknesses (CWE)
CWE-863
Affected products
0 configuration(s)
Published / Modified
2026-07-03 / 2026-07-06

NVD description (verbatim)

Gitea 1.25.5 caches a branch-specific write-permission result across multiple refs in one pre-receive hook session, allowing a per-branch maintainer-edit grant to be reused for other refs and escalate to full repository write access.

5 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-27775 stems from improper permission-cache management in Gitea's pre-receive hook processing. The vulnerability leverages CWE-863 (Incorrect Authorization) by caching branch-specific write-permission verdicts at the session level rather than evaluating permissions per-ref. When a push targets multiple refs or when authorization checks are performed once and reused, a user granted write access to a single branch can bypass controls and modify unintended refs. The flaw is specific to Gitea 1.25.5 and affects the permission model during git push operations.

Business impact

This vulnerability enables insider threats and compromised low-privilege accounts to escalate to repository-wide write access without additional credentials or configuration changes. An attacker could inject malicious commits into production branches, delete critical release tags, or alter deployment automation. For organizations using Gitea as a central code repository, this poses a significant integrity and supply-chain risk, particularly if branch protection rules are relied upon to enforce code review or separation of duties.

Affected systems

Gitea version 1.25.5 is vulnerable. Organizations running this specific version should inventory affected instances immediately. Gitea deployments in self-hosted or private cloud environments are in scope. The vulnerability does not appear in the vendor advisory data to affect other versions, but users should verify patch availability and upgrade paths with the Gitea project.

Exploitability

Exploitation requires valid Gitea credentials (PR:L in the CVSS vector), but no complex attack setup is needed—a standard git push operation can trigger the flaw. No user interaction is required beyond the attacker's own push. The network-accessible nature of git repositories (AV:N) and lack of complex prerequisites (AC:L) make this straightforward to exploit once an attacker has any branch-write permission. The high impact (C:H, I:H, A:H covering confidentiality, integrity, and availability) reflects the ability to read, modify, or delete repository content at scale.

Remediation

Upgrade Gitea to a patched version that fixes permission-cache handling in pre-receive hooks. Verify the exact patched version against the Gitea security advisory or release notes. As an interim control, restrict branch-write permissions to trusted users only and enforce repository-wide access policies. Consider disabling or auditing pre-receive hooks pending patch deployment.

Patch guidance

Check the Gitea project's official releases and security advisories for a version beyond 1.25.5 that addresses CVE-2026-27775. Apply the patch promptly to all affected Gitea instances, prioritizing production repositories. Test the upgrade in a staging environment first, particularly if you use custom pre-receive hooks or branch protection rules, to ensure no regression in authorization behavior.

Detection guidance

Monitor git push operations targeting multiple refs or refs outside the user's expected write scope. Log and alert on authorization cache hits or permission reuse events in Gitea's audit trail. Review pre-receive hook execution logs for instances where a single authorization decision was applied across multiple branches. Inspect recent git history for unexpected commits or deletions by users with limited historical privileges. Network-based detection is difficult; focus on repository-side logs and access patterns.

Why prioritize this

The combination of high CVSS score (8.8), broad impact (full repository write access), low barrier to exploitation (any authenticated user with branch-write permission), and the clear path to insider escalation make this a critical priority. Organizations should treat patching or mitigating this vulnerability as urgent to prevent code tampering and supply-chain compromise.

Risk score, explained

CVSS 3.1 score of 8.8 (HIGH) reflects network accessibility, low attack complexity, low privilege requirement, high impact on confidentiality/integrity/availability, and no user interaction needed. The vulnerability enables an authenticated attacker to escalate from limited branch access to full repository control, satisfying all high-impact criteria. The absence of scope change (S:U) slightly constrains the theoretical maximum score but does not diminish the real-world threat.

Frequently asked questions

Does this vulnerability affect Gitea versions other than 1.25.5?

The available data confirms CVE-2026-27775 affects Gitea 1.25.5. Verify with the Gitea security advisory whether other versions in the 1.25.x line or adjacent releases are in scope, as permission bugs can sometimes affect multiple builds.

Can an unauthenticated attacker exploit this?

No. The CVSS vector requires PR:L (low privileges), meaning the attacker must have a valid Gitea account with at least branch-write permission. However, this is often easier to obtain than full repository access, making the escalation path realistic for insider or compromised-account scenarios.

What is the difference between this and a typical branch protection bypass?

Branch protection rules typically prevent pushes to certain refs based on policy (e.g., requiring pull request approval). This vulnerability circumvents the permission logic itself by reusing a cached authorization decision, allowing an attacker to push to branches they should not be able to touch, regardless of branch protection configuration.

Should we block all git operations until we patch?

Not necessarily, but reducing write permissions to the minimum required and monitoring for unusual access patterns is prudent. If patching is delayed, consider disabling pre-receive hooks or tightening branch-specific access controls to trusted administrators only.

This analysis is provided for informational purposes. The vulnerability details, affected versions, and patch information are based on available data as of the publication date. Organizations should verify all technical claims and patch availability against the Gitea project's official security advisories and release notes. No liability is assumed for use of this information in remediation decisions. Proof-of-concept code, exploit demonstrations, and weaponized tooling are not provided herein. Source: NVD (public-domain), retrieved 2026-08-12. Analysis generated by SEC.co (claude-haiku-4-5).