/

CVE-2026-27771

Severity:

HIGH RISK

(8.2)

Missing Access Control (CWE-862) in Gitea Composer

CVE-2026-27771

Deferred

Vulnerability type

Category:

Missing Authorization

CWE:

CWE-862

Impact:

Information Disclosure

Severity:

HIGH RISK

(8.2)

CVSS version:

3.0

Catch this CVE while code is being written

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

Summary

Insufficient permission checks in Gitea's Composer package source links can expose private or internal package source information to unauthorized users.

When Composer metadata or links are served without verifying repository permissions, sensitive project details may become visible beyond the intended audience.

Affected context

This vulnerability affects Gitea instances that host Composer packages and expose their metadata or source links through HTTP endpoints.

It is most relevant where private or internal repositories are used as Composer package sources, and where access control is expected to restrict who can discover or view those source locations.

Environments that rely on Gitea for both public and private package distribution are particularly exposed when package metadata is reused across trust boundaries without additional checks.

Exploit preconditions

  • Attack surface: Web endpoints serving Composer package metadata or source links
  • Required access: Network access to the Gitea instance (no prior repository permissions required in the failure case)
  • Trigger point: Requests for Composer package information, such as fetching package metadata or source URLs
  • Why exploitation is possible: Authorization checks are missing or incomplete for specific Composer-related routes, allowing responses to be generated without verifying whether the requester is allowed to access the underlying repository or package

Why this happens

The root cause is a missing or insufficient authorization check (CWE-862) in the code paths that generate or serve Composer package source links.

Instead of consistently validating that the requesting user or token has permission to access the backing repository or package, certain endpoints return metadata unconditionally or with weaker checks than the rest of the system.

This design flaw breaks the assumption that private or internal repositories remain undiscoverable via package tooling, allowing metadata that should be access-controlled to be queried anonymously or by low-privileged users.

Potential impact

  • Unauthorized users may discover the existence and names of private or internal repositories.
  • Internal package source URLs, including hostnames and paths, could be exposed to external parties.
  • Attackers can gain insight into project structure, dependencies, and internal architecture.
  • Sensitive metadata embedded in package configuration or source references may be revealed.
  • Information leakage could aid in targeted attacks such as dependency confusion or phishing.

General mitigation guidance

Defenses center on enforcing consistent, centralized authorization for all package-related endpoints and treating metadata as sensitive.

Common mitigation patterns include:

  • Applying the same permission checks on Composer metadata and source link endpoints as on normal repository browsing and clone operations.
  • Introducing an authorization layer or middleware that validates user or token permissions before serving any package metadata derived from private or internal repositories.
  • Designing package registries so that metadata for private packages is never served to unauthenticated or unprivileged callers, even if the data appears harmless.
  • Reducing the amount of sensitive context embedded in package metadata and source URLs, minimizing leaked details if a control fails.
  • Following the principle of least privilege for access tokens used by package managers, restricting them to only the repositories they truly need.

How teams detect issues like this

Detection efforts typically focus on identifying endpoints that bypass authorization for sensitive metadata.

Helpful strategies include:

  • Static analysis rules or code search patterns looking for HTTP handlers serving Composer or package registry data that do not invoke standard authorization checks.
  • Code review practices that treat any new registry or metadata endpoint as sensitive and verify it uses shared access-control mechanisms.
  • Logging and monitoring of requests to package metadata endpoints, correlating them with authenticated identities to detect anonymous or unexpected access patterns.
  • Security testing and automated scanning that attempts to fetch private package metadata while using low-privilege or unauthenticated contexts, checking for unintended data exposure.

Sources

SourceLink
blog.gitea.comblog.gitea.com/release-of-1.26.2/
github.comgithub.com/go-gitea/gitea/pull/37610
github.comgithub.com/go-gitea/gitea/releases/tag/v1.26.2
github.comgithub.com/go-gitea/gitea/security/advisories/GHSA-8qw8-rq86-9pc2

Frequently asked

questions

Yes. If the Gitea instance is reachable over the network and exposes Composer endpoints, a remote attacker can attempt to query package metadata and source links without prior access.

Typically, only basic network access to the Gitea server is required in the affected configuration. The core issue is that certain Composer-related endpoints may respond even when the requester lacks explicit permissions for the underlying repository.

The safest pattern is to route all Composer and package registry endpoints through the same centralized authorization logic used for repositories, ensuring that access checks are performed before any metadata or links derived from private or internal sources are returned.

Prevention relies on designing APIs with "deny by default" semantics, using shared middleware for authorization, treating metadata as potentially sensitive, and including access-control checks as a mandatory part of code reviews and automated tests for all new endpoints.

Find out what's already
exploitable in your codebase.