Summary
CVE-2026-27771 is a high-severity authentication bypass in Gitea’s built-in container registry, affecting all versions up to and including 1.26.1. The flaw allows unauthenticated remote attackers to obtain bearer tokens and pull private container images without any credentials, exposing source code, embedded secrets, and internal infrastructure details. With a CVSS score of 8.2 and over 30,000 internet-facing instances identified as potentially vulnerable, the risk of data exposure is significant and broadly distributed.
Technical details
- Root cause: The
/v2/tokenendpoint issues anonymous bearer tokens (with an internal UserID of -1) without scope restrictions. TheReqContainerAccessmiddleware fails to validate package owner visibility, meaning containers marked as private are not actually access-controlled at the registry layer. - Trigger conditions: No authentication, account, or prior access to the target instance is required. A standard Docker/OCI pull workflow is sufficient to trigger the bypass.
- Attack vector: Remote, network-accessible, unauthenticated. Exploitation follows three steps: (1) send a request to
/v2/to confirm the registry endpoint is active; (2) request/v2/token?service=container_registry&scope=*to receive an anonymous bearer token; (3) use that token to enumerate repositories via/_catalogand pull private image layers. - Impact: Full read access to private container images. Exposed content may include proprietary application source code, hardcoded credentials, API keys, and internal infrastructure configuration. CVSS confidentiality impact is rated High; integrity impact is rated Low (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N).
- Flaw duration: The vulnerability is reported to have existed for approximately four years prior to being patched in version 1.26.2.
- Also affected: Forgejo, a widely used Gitea-derived fork, has been confirmed vulnerable.
- Public PoC availability: Multiple public proof-of-concept repositories exist, and a detection template has been merged to the nuclei-templates repository.
Affected software
- Gitea Open Source Git Server — all versions up to and including 1.26.1
- Forgejo — versions sharing the same container registry implementation (confirmed affected)
Severity
- CVSS v3.0 Base Score: 8.2
- Vector string:
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
Mitigation and recommended actions
- Immediate (preferred): Upgrade Gitea to version 1.26.2 or later, which contains the vendor-provided fix. Forgejo users should apply the equivalent patched release from the Forgejo project.
- Temporary workaround (if patching is not immediately possible): Set
REQUIRE_SIGNIN_VIEW = trueunder the[service]section of the Gitea configuration file. Note: this setting restricts all anonymous access to the instance, including intentionally public repositories and packages, and should be considered a temporary measure only until patching is feasible. - Prioritize instances exposed to the internet, particularly those hosting container images for production systems or those containing sensitive application code and credentials.
IONIX Status
The IONIX research team is tracking ongoing exploitation attempts and recommends immediate patching. Potentially affected assets are outlined in this post.

