/

CVE-2026-79960

Severity:

HIGH RISK

(7.1)

Incorrect Authorization (CWE-863) in Gitea Push Hooks

CVE-2026-79960

Analyzed

Vulnerability type

Category:

Incorrect Authorization

CWE:

CWE-863

Impact:

Authorization Bypass and Repository Integrity or Confidentiality Loss

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Gitea incorrectly attributed deploy-key-authenticated pushes to the repository owner during push hook permission checks. A holder of a writable deploy key could therefore bypass protected-tag allow lists, change repository visibility through push options, and have AGit pull requests attributed to the owner.

Gitea incorrectly attributed deploy-key-authenticated pushes to the repository owner during push hook permission checks. A holder of a writable deploy key could therefore bypass protected-tag allow lists, change repository visibility through push options, and have AGit pull requests attributed to the owner.

Affected context

The issue occurs in Gitea repositories that use writable deploy keys and rely on push hook authorization for protected tags or push-option handling. It is relevant when the hook pipeline resolves the authenticated principal as the repository owner rather than as the deploy key identity.

The issue occurs in Gitea repositories that use writable deploy keys and rely on push hook authorization for protected tags or push-option handling. It is relevant when the hook pipeline resolves the authenticated principal as the repository owner rather than as the deploy key identity.

Exploit preconditions

  • Attack surface: Git push handling and related push hook processing
  • Required access: A writable deploy key for the target repository
  • Trigger point: A push involving protected tags or supported push options, or an AGit pull-request flow
  • Why exploitation is possible: Authorization checks use the repository owner identity instead of the deploy key's effective principal
  • Attack surface: Git push handling and related push hook processing
  • Required access: A writable deploy key for the target repository
  • Trigger point: A push involving protected tags or supported push options, or an AGit pull-request flow
  • Why exploitation is possible: Authorization checks use the repository owner identity instead of the deploy key's effective principal

Why this happens

The underlying defect is an authorization-context confusion error. Although the request was authenticated with a deploy key, downstream permission checks treated the repository owner as the actor, causing access-control decisions to be evaluated against the wrong identity. This maps to CWE-863: Incorrect Authorization, where a valid request is permitted without correctly enforcing the intended subject's permissions.

The underlying defect is an authorization-context confusion error. Although the request was authenticated with a deploy key, downstream permission checks treated the repository owner as the actor, causing access-control decisions to be evaluated against the wrong identity. This maps to CWE-863: Incorrect Authorization, where a valid request is permitted without correctly enforcing the intended subject's permissions.

Potential impact

  • An attacker may create protected tags without being on the configured allow list.
  • A private repository could be made public through permitted push-option processing.
  • Repository integrity and release-management controls could be weakened.
  • Pull requests may be attributed to the wrong identity, complicating auditing and accountability.
  • An attacker may create protected tags without being on the configured allow list.
  • A private repository could be made public through permitted push-option processing.
  • Repository integrity and release-management controls could be weakened.
  • Pull requests may be attributed to the wrong identity, complicating auditing and accountability.

General mitigation guidance

Mitigation generally focuses on preserving the authenticated principal throughout the complete authorization pipeline.

Common defensive patterns include:

  • Distinguishing deploy keys, users, applications, and repository owners as separate authorization subjects.
  • Performing protected-tag and push-option checks against the actual authenticated identity.
  • Applying explicit allow lists and deny-by-default rules to sensitive repository operations.
  • Restricting deploy-key write access to repositories and workflows that require it.
  • Limiting which push options can alter repository state or visibility.
  • Recording the effective authentication principal consistently for audit and pull-request attribution.

Mitigation generally focuses on preserving the authenticated principal throughout the complete authorization pipeline.

Common defensive patterns include:

  • Distinguishing deploy keys, users, applications, and repository owners as separate authorization subjects.
  • Performing protected-tag and push-option checks against the actual authenticated identity.
  • Applying explicit allow lists and deny-by-default rules to sensitive repository operations.
  • Restricting deploy-key write access to repositories and workflows that require it.
  • Limiting which push options can alter repository state or visibility.
  • Recording the effective authentication principal consistently for audit and pull-request attribution.

How teams detect issues like this

Organizations can look for authorization-context confusion through:

  • Static analysis and code review checks that trace authenticated identities into permission decisions.
  • Tests covering deploy keys, protected tags, push options, repository visibility changes, and AGit workflows.
  • Audit-log comparisons between the authentication method, recorded pusher, and authorization subject.
  • Policy enforcement requiring security-sensitive operations to use explicit principal types and deny-by-default checks.
  • Automated review tools that flag authorization decisions based on repository ownership rather than the authenticated actor.

Organizations can look for authorization-context confusion through:

  • Static analysis and code review checks that trace authenticated identities into permission decisions.
  • Tests covering deploy keys, protected tags, push options, repository visibility changes, and AGit workflows.
  • Audit-log comparisons between the authentication method, recorded pusher, and authorization subject.
  • Policy enforcement requiring security-sensitive operations to use explicit principal types and deny-by-default checks.
  • Automated review tools that flag authorization decisions based on repository ownership rather than the authenticated actor.

Sources

SourceLink
blog.gitea.comblog.gitea.com/release-of-28.0.0/
github.comgithub.com/go-gitea/gitea/pull/37306
github.comgithub.com/go-gitea/gitea/releases/tag/v28.0.0
github.comgithub.com/go-gitea/gitea/security/advisories/GHSA-7769-9pr9-m24h

Frequently asked

questions

Yes. A holder of a writable deploy key may be able to trigger the vulnerable push-processing paths over the Git service interface.

The attacker needs a deploy key with write capability for the affected repository. Read-only keys do not provide the required push access.

Ensure every authorization decision uses the actual authenticated principal, treating deploy keys separately from repository owners and applying deny-by-default checks to sensitive operations.

Add authorization tests for every supported authentication type, verify audit attribution, restrict deploy-key privileges, and monitor attempts to modify protected tags or repository visibility.

Yes. A holder of a writable deploy key may be able to trigger the vulnerable push-processing paths over the Git service interface.

The attacker needs a deploy key with write capability for the affected repository. Read-only keys do not provide the required push access.

Ensure every authorization decision uses the actual authenticated principal, treating deploy keys separately from repository owners and applying deny-by-default checks to sensitive operations.

Add authorization tests for every supported authentication type, verify audit attribution, restrict deploy-key privileges, and monitor attempts to modify protected tags or repository visibility.

Find out what's already
exploitable in your codebase.