Skip to content

Gitea: Fork Synchronization Continues After Parent Repository Changes from Public to Private

High severity GitHub Reviewed Published Jun 21, 2026 in go-gitea/gitea • Updated Jul 21, 2026

Package

gomod code.gitea.io/gitea (Go)

Affected versions

< 1.26.3

Patched versions

1.26.3

Description

Summary

The POST /api/v1/repos/{owner}/{repo}/merge-upstream endpoint continues to synchronize commits from a parent repository after the parent repository has been changed from public to private.

A fork created while the parent repository was public can still receive commits made after the parent repository becomes private. As a result, content added during the private period becomes available through the fork repository after synchronization.

Details

Gitea provides the merge-upstream API to synchronize a fork with its parent repository.

A typical workflow is:

  1. A repository is public.
  2. Another user creates a fork.
  3. The fork owner uses merge-upstream to receive updates from the parent repository.

However, if the parent repository is later changed from public to private, the synchronization endpoint continues to import new commits from the parent repository into the fork.

In testing on Gitea 1.26.2, a fork owner who can no longer directly access the parent repository is still able to synchronize newly created commits from the parent repository into the fork by calling merge-upstream.

As a result, commits created after the visibility change can be propagated into the fork through the normal fork synchronization workflow.

PoC

Proof-of-Concept Code

https://anonymous.4open.science/r/Gitea_PoC-EC93/4_poc_merge_upstream

PoC Details

  1. User alice creates a public repository alice/P.
  2. User bob forks the repository, creating bob/P.
  3. alice changes alice/P from public to private.
  4. Verify that bob can no longer directly access the parent repository:
GET /api/v1/repos/alice/P

Response:

404 Not Found
GET /api/v1/repos/alice/P/contents/README.md

Response:

404 Not Found
  1. While the repository is private, alice commits a new file:
secret.txt
  1. Verify that bob cannot directly access the new file from the parent repository:
GET /api/v1/repos/alice/P/contents/secret.txt

Response:

404 Not Found
  1. bob synchronizes the fork:
POST /api/v1/repos/bob/P/merge-upstream

Response:

200 OK
  1. The newly added file is now available through the fork repository:
GET /api/v1/repos/bob/P/contents/secret.txt

Response:

200 OK

The attached PoC reproduces the behavior end-to-end.

As a control test, attempting to access the private-period commit directly through the fork's Git API before synchronization fails:

GET /api/v1/repos/bob/P/git/commits/<private-period-commit-sha>

Response:

404 Not Found

This indicates that the commit becomes available in the fork only after the merge-upstream operation synchronizes it from the parent repository.

Impact

A fork created while a repository is public can continue receiving updates from the parent repository after the parent repository is changed to private.

Consequently, content committed after the visibility change may become available through fork synchronization even when the fork owner can no longer directly access the parent repository.

The impact is limited to content that is synchronized from the parent repository into the affected fork. The issue does not allow modification of the parent repository or access to repositories that were never forked.

References

@bircni bircni published to go-gitea/gitea Jun 21, 2026
Published by the National Vulnerability Database Jul 3, 2026
Published to the GitHub Advisory Database Jul 21, 2026
Reviewed Jul 21, 2026
Last updated Jul 21, 2026

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(40th percentile)

Weaknesses

Exposure of Sensitive Information to an Unauthorized Actor

The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. Learn more on MITRE.

Improper Access Control

The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. Learn more on MITRE.

CVE ID

CVE-2026-24451

GHSA ID

GHSA-wrf9-r3h7-7x5v

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.