Vulnerabilities in pkg:golang/code.gitea.io/gitea

PACKAGE
Advisory Identifier: GHSA-7p4h-3gxq-x3h3
Advisory Summary

CVE-2026-56443 is a MODERATE (CVSS 4.3) token public-only scope bypassed on vulnerability (CWE-863: Incorrect Authorization) affecting Gitea libraries in the Go ecosystem. The issue involves token public-only scope bypassed on limited-visibility owners (repository + package categories) — residual after cve-2026-25714 / pr #37118. Remediation is available by upgrading affected packages to version 1.27.0.

109 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/code.gitea.io/gitea

109 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/code.gitea.io/gitea. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7p4h-3gxq-x3h3 CVE-2026-56443 MODERATE Gitea: Token public-only scope bypassed on Limited-visibility owners (Repository + Package categories) — residual after CVE-2026-25714 / PR #37118
GHSA-2fcr-jfvc-vgg2 CVE-2026-58314 HIGH Gitea: Two SSRF findings
GHSA-2wm4-vwp6-v7xc CVE-2026-59765 MODERATE Gitea: SSRF via Migration Asset Downloads Bypasses hostmatcher — Reads Internal Files and Cloud Metadata
GHSA-4xjf-493q-98p3 CVE-2026-56657 MODERATE Gitea SSH Key Parser Denial of Service
GHSA-vhq7-fwwh-7hjf CVE-2026-27780 CRITICAL Gitea pre-receive hook scanner errors allow branch-protection bypass
GHSA-x92v-f5gc-r34v CVE-2026-27660 HIGH Gitea draft releases and attachments are exposed without write permission
GHSA-v8f2-2ghq-9whv CVE-2026-27779 HIGH Gitea forwarded-proto validation allows canonical URL spoofing
GHSA-7jvx-g65v-r899 CVE-2026-28705 MODERATE Gitea release asset dumps permit path traversal through crafted names
GHSA-5v69-g2m3-3hq3 CVE-2026-26232 CRITICAL Gitea OAuth2 authorization codes can be reused after expiry
GHSA-m5ch-ppfx-xv3v CVE-2026-26247 CRITICAL Gitea OAuth2 PKCE S256 verifier bypass
GHSA-qm72-8prh-g92x CVE-2026-25782 MODERATE Gitea tracked-time deletion is not scoped to the requested issue
GHSA-37w2-86g3-h4qh CVE-2026-25712 HIGH Gitea organization permission APIs expose hidden membership and private organization data
GHSA-rc56-rj3f-xggf CVE-2026-26292 CRITICAL Gitea LFS mirror operations bypass migration HTTP transport protections
GHSA-h9c5-x7g8-4q7f CVE-2026-26307 HIGH Gitea git grep searches allow server resource exhaustion
GHSA-4c8f-3m6h-m56r CVE-2026-27657 HIGH Gitea primary email ownership bypass allows cross-user email changes
GHSA-47rq-xp99-92mx CVE-2026-24690 HIGH Gitea pull request branch permission checks allow unauthorized updates and rebases
GHSA-h697-89cp-24q8 CVE-2026-25718 CRITICAL Gitea template repository generation follows unsafe filesystem paths
GHSA-922f-hfwp-p56f CVE-2026-22547 CRITICAL Gitea repository creation accepts insufficiently validated fields
GHSA-fhq3-p242-2qpf CVE-2026-20909 MODERATE Gitea exposes tracked time entries without repository authorization
GHSA-gx3v-q759-g323 CVE-2026-20779 HIGH Gitea: TOTP TOCTOU race on web 2FA paths + missing replay check on Basic-Auth `X-Gitea-OTP` surface
GHSA-fq2p-5p22-8g6j CVE-2026-58429 MODERATE Gitea: Public-Only Personal access tokens scope bypass in Organization and Permission Endpoints
GHSA-3r5c-2xxx-h872 CVE-2026-58511 LOW Gitea: Webhook Authorization Header Returned in Plaintext via API
GHSA-frpw-3h2q-4jj6 CVE-2026-57897 MODERATE Gitea: Cross-Repo Information Disclosure via Org-Level Actions Run/Job APIs
GHSA-q423-49rw-g9mh CVE-2026-58510 MODERATE Gitea: GHSA-8fwc-qjw5-rvgp ClearRepoWatches fix not applied to API EditRepo path — sister code path retains stale watches on public->private
GHSA-g9g6-qhrc-p3qc CVE-2026-58422 HIGH Gitea: Improper authorization on OAuth sign-in callback silently re-enables administrator-disabled accounts
GHSA-44qc-pgvp-wx7v CVE-2026-58419 HIGH Gitea: Notification API leaks private issue metadata after access revocation
GHSA-v73x-hx65-6pf4 CVE-2026-25038 HIGH Gitea: Unauthorized Access to Labels of Private Organizations
GHSA-649p-mmhf-85c7 CVE-2026-27775 HIGH Gitea: Cached Per-Branch Permission Check in Pre-Receive Hook Allows Full Repository Write
GHSA-wrf9-r3h7-7x5v CVE-2026-24451 HIGH Gitea: Fork Synchronization Continues After Parent Repository Changes from Public to Private
GHSA-fw57-jgch-pgf3 CVE-2026-58436 HIGH Gitea: ParseAcceptLanguage quadratic-time DoS via Locale middleware on unauthenticated requests
GHSA-8p9h-49rc-qgxj CVE-2026-58437 HIGH Gitea: Repository Visibility Manipulation via Git Push Options
GHSA-vrhc-jjfc-m3m3 CVE-2026-55987 HIGH Gitea: OAuth2 sign-in reactivates an administrator-deactivated account on auth sources without refresh tokens (incomplete fix of #38009)
GHSA-rh79-75qm-gwjr CVE-2026-58435 MODERATE Gitea LFS Deploy-Key Privilege Escalation
GHSA-m932-crvm-gcp5 CVE-2026-55984 LOW Gitea: Null Pointer Dereference in AddTime API Causes Authenticated Denial of Service
GHSA-mg4f-x9v4-6h2p CVE-2026-55982 MODERATE Gitea: OIDC userinfo Endpoint Returns Identity Claims Without Enforcing API Token Scopes
GHSA-j2w3-9c3r-g83q CVE-2026-58434 LOW Gitea: Private Repository Metadata Remains Accessible After Access Revocation
GHSA-94v3-77j7-vm48 CVE-2026-54481 HIGH Gitea: Internal API HTTP client hardcodes InsecureSkipVerify:true with no config override
GHSA-6cqf-375w-639g CVE-2026-50105 MODERATE Gitea: RSS/Atom feed handlers bypass API-token scope & public-only confinement (incomplete fix of #37698)
GHSA-wwqq-x6w4-frm2 CVE-2026-42931 MODERATE Gitea: Denial of Service via Unbounded io.ReadAll in NPM Package Tag Endpoint
GHSA-pgqf-926r-548m CVE-2026-58445 LOW Gitea: Cross-repository label-ID enumeration oracle via unscoped DeleteIssueLabel API
GHSA-cp3q-vrj2-ghhh CVE-2026-58444 MODERATE Gitea: Personal access token scope enforcement bypass on the repository home page (`GET /{owner}/{repo}`) discloses private repository contents
GHSA-xxjv-752h-3vp2 CVE-2026-58443 CRITICAL Gitea: Public-only repository tokens can update private PR head branches
GHSA-h2x6-g7q6-344v CVE-2026-58442 MODERATE Gitea: Repository migration SSRF via multi-answer DNS allow-list bypass
GHSA-xmj7-xj85-hfc3 CVE-2026-58441 MODERATE Gitea: SSRF in restore-repo via unsanitized pull_request.yml Head.CloneURL
GHSA-hg5r-vq93-9fv6 CVE-2026-58426 CRITICAL Gitea Actions Artifacts V4 signed URL HMAC ambiguity allows cross-repository artifact read and cross-task upload-state write
GHSA-777r-4v59-6486 CVE-2026-58424 HIGH Gitea: Permanent Fork PR Workflow Approval Gate Bypass
GHSA-7wvc-rvp7-w99x CVE-2026-58423 HIGH Gitea: LFS authentication bypass via malformed SSH sub-verb allows unauthorized read access to private repositories
GHSA-v96j-25gv-g2w9 CVE-2026-58421 HIGH Gitea: Unauthenticated ReDoS via CODEOWNERS pattern matching allows denial of service
GHSA-rqhx-647v-wx32 CVE-2026-58418 MODERATE Gitea: SSRF via HTTP Redirect in Repository Migration
GHSA-3pww-vcvm-3gmj CVE-2026-27761 MODERATE Gitea: API access token scope enforcement bypass on repository RSS/Atom feed endpoints leaks private repository commit data
GHSA-f75j-4cw6-rmx4 CVE-2026-20896 CRITICAL Gitea Docker image: `REVERSE_PROXY_TRUSTED_PROXIES = *` default lets any source IP impersonate any user via `X-WEBAUTH-USER`
GHSA-2r5c-gw76-rh3w CVE-2026-22874 CRITICAL Gitea: Incomplete SSRF Protection in Webhook and Migration Allow-list Default Filter
GHSA-rjvx-x5h2-6px5 - MODERATE Gitea: API Fork Endpoint Authorization Bypass Allows Organization Members to Bypass Repository Creation Restrictions
GHSA-683j-3ff6-hh2x CVE-2026-56654 HIGH Gitea: Privilege Escalation via Access Token Scope Escalation in API
GHSA-6hm7-3pwj-22rm CVE-2026-56755 HIGH Gitea: Denial of Service (CPU & Memory Exhaustion) via O(N^2) String Concatenation in Debian Package Upload
GHSA-p4mj-98mv-xq26 CVE-2026-58507 MODERATE Gitea: Private Repository Existence Disclosure via go-get Meta Endpoint
GHSA-6c6r-5xr4-cr5m CVE-2026-57886 MODERATE Gitea: Cross-repository issue/comment attachment re-linking can expose private attachment content
GHSA-x77v-q46j-393g CVE-2026-23603 LOW Gitea: Blind SSRF in OAuth2 avatar synchronization via unvalidated OIDC picture claim
GHSA-vxv2-8j6r-pcpg CVE-2026-58425 MODERATE Gitea: OAuth token introspection returns metadata of tokens issued to other clients (RFC 7662 section 4 violation)
GHSA-9mq6-mqjj-c2c5 CVE-2026-59763 MODERATE Gitea: Unbounded Arch package file metadata can cause resource amplification in Gitea package uploads
GHSA-rgv6-xp99-6mgj CVE-2026-56750 CRITICAL Gitea Remember-Me Token Theft Not Invalidating Attacker Session
GHSA-q9pg-jj6x-j9p6 CVE-2026-58432 MODERATE Gitea: draft release attachment disclosure via missing web authorization
GHSA-25gq-j9jx-43pg CVE-2026-58428 MODERATE Gitea: Release attachment extension allowlist bypass via web release edit form (variant of CVE-2025-68939)
GHSA-w5pg-649r-p6gg CVE-2026-58439 HIGH Gitea: Branch Protection Bypass via PR Retargeting Preserves Stale `official` Approval Flag
GHSA-qf2f-qh6p-7v89 CVE-2026-59766 MODERATE Gitea CVE-2026-20800 sibling endpoints not covered: revoked user still reads private repo objects via `/api/v1/user/starred` and private issue titles via `/api/v1/user/times`
GHSA-82f7-87hm-852x CVE-2026-57894 HIGH Gitea: Repository Migration Follows Git HTTP Redirects After URL Allow/Block Validation, Enabling Internal Git Repository Exfiltration
GHSA-8qw8-rq86-9pc2 CVE-2026-27771 HIGH Gitea has insufficient permission checks for Composer package source links
GHSA-9cpj-qc93-vw8v CVE-2026-28737 HIGH Gitea: Stored XSS via glTF `extensionsRequired` in Gitea 3D File Viewer
GHSA-wrr5-99h5-gq57 CVE-2026-24791 HIGH Gitea: Public-only tokens bypass private-resource restrictions on `/api/v1/user` self routes
GHSA-fhx7-m96w-mv29 CVE-2026-22555 HIGH Gitea: API Fork Missing CanCreateOrgRepo Check Allows Org Secret Exfiltration
GHSA-cr4g-f395-h25h CVE-2026-20706 MODERATE Gitea: Token scope bypass on web archive download endpoint
GHSA-3fwp-p5rj-2pxf CVE-2026-27783 MODERATE Gitea: Missing repository-unit authorization on issue-template API endpoints
GHSA-8629-vc8r-5p58 CVE-2026-25714 MODERATE Gitea: Incomplete CVE-2025-68941 fix: /user/orgs missing checkTokenPublicOnly + switch-case logic flaw
GHSA-mm7c-rhg6-qr4r CVE-2026-26231 HIGH Gitea: Authorization Bypass via "Allow edits from maintainers" allows unauthorized commits to any readable repo
GHSA-9r5x-wg6m-x2rc CVE-2026-28699 HIGH Gitea: OAuth2 access token scope enforcement bypass via HTTP Basic authentication
GHSA-cc8w-r4qh-3v65 CVE-2026-28744 HIGH Gitea: Git Smart HTTP Skips Repository Token Scopes for Bearer Tokens
GHSA-3m6q-h5gj-7mrw - MODERATE Gitea has insecure default SSH settings
GHSA-hgr3-x44x-33hx CVE-2026-20736 LOW Gitea has improper access control for uploaded attachments
GHSA-8fwc-qjw5-rvgp CVE-2026-0798 LOW Gitea may send release notification emails for private repositories to users whose access has been revoked
GHSA-pc73-rj2c-wvf9 CVE-2025-69413 MODERATE Gitea's /api/v1/user endpoint has different responses for failed authentication depending on whether a username exists
GHSA-hq57-c72x-4774 CVE-2025-68946 MODERATE Gitea vulnerable to Cross-site Scripting
GHSA-7xq4-mwcp-q8fx CVE-2025-68945 MODERATE Gitea: anonymous user can visit private user's project
GHSA-f85h-c7m6-cfpm CVE-2025-68944 MODERATE Gitea sometimes mishandles propagation of token scope for access control within one of its own package registries
GHSA-jhx5-4vr4-f327 CVE-2025-68943 MODERATE Gitea inadvertently discloses users' login times by allowing (for example) the lastlogintime explore/users sort order
GHSA-898p-hh3p-hf9r CVE-2025-68942 MODERATE Gitea allows XSS because the search input box (for creating tags and branches) is v-html instead of v-text
GHSA-xfq3-qj7j-4565 CVE-2025-68941 MODERATE Gitea mishandles access to a private resource upon receiving an API token with scope limited to public resources
GHSA-rrcw-5rjv-vj26 CVE-2025-68940 LOW Gitea doesn't adequately enforce branch deletion permissions after merging a pull request.
GHSA-263q-5cv3-xq9g CVE-2025-68939 HIGH Gitea allows attackers to add attachments with forbidden file extensions
GHSA-cm54-pfmc-xrwx CVE-2025-68938 MODERATE Gitea mishandles authorization for deletion of releases
GHSA-fhv8-m4j4-cww2 CVE-2022-38183 MODERATE Gitea allowed assignment of private issues
GHSA-4h4p-553m-46qh CVE-2024-6886 CRITICAL Gitea Cross-site Scripting Vulnerability
GHSA-j99q-rwp6-498g CVE-2019-1000002 MODERATE Gitea Arbitrary File Delete Vulnerability
GHSA-4rqq-rxvc-v2rc CVE-2022-1058 MODERATE Gitea Open Redirect
GHSA-3393-r4p5-vhqh CVE-2019-11576 CRITICAL Gitea Allows 1FA Even for 2FA-Enrolled Accounts
GHSA-hqx2-j33x-9fc4 CVE-2019-1010314 MODERATE Gitea XSS Vulnerability in Repository Description
GHSA-3h6c-c475-jm7v CVE-2020-14144 HIGH Arbitrary Code Execution in Gitea
GHSA-5rh7-6gfj-mc87 CVE-2019-1010261 MODERATE Gitea XSS Vulnerability
GHSA-hfmf-q69j-6m5p CVE-2021-45331 CRITICAL Reuse of one time passwords allowed in Gitea
GHSA-hf6f-jq25-8gq9 CVE-2018-18926 CRITICAL Gitea Remote Code Execution (RCE)
GHSA-8j3v-68w3-3848 CVE-2022-38795 MODERATE Gitea erroneous repo clones
GHSA-fg3x-rwq9-74cw CVE-2018-15192 HIGH Gogs and Gitea SSRF Vulnerability
GHSA-cf6v-9j57-v6r6 CVE-2023-3515 LOW code.gitea.io/gitea Open Redirect vulnerability
GHSA-jr9c-h74f-2v28 CVE-2022-0905 HIGH Gitea Missing Authorization vulnerability
GHSA-pg38-r834-g45j CVE-2021-45330 CRITICAL Improper Privilege Management in Gitea
GHSA-ph3w-2843-72mx CVE-2022-1928 MODERATE Stored Cross-site Scripting in gitea
GHSA-p5f9-c9j9-g8qx CVE-2022-30781 HIGH Shell command injection in gitea
GHSA-g7p7-x6w7-w6qg CVE-2022-27313 HIGH Arbitrary file deletion in gitea
GHSA-h3q4-vmw4-cpr5 CVE-2021-29134 MODERATE Path Traversal in Gitea
GHSA-g95p-88p4-76cm CVE-2021-28378 MODERATE Cross-site Scripting in Gitea

CVE-2026-56443 at a Glance

CVE Identifier CVE-2026-56443
GHSA Identifier GHSA-7p4h-3gxq-x3h3
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-863: Incorrect Authorization
Affected Product Gitea
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-56443

To remediate this vulnerability, upgrade all affected Gitea dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

code.gitea.io/gitea fixed: 1.27.0
Upgrade code.gitea.io/gitea to 1.27.0
gitea.dev fixed: 1.27.0
Upgrade gitea.dev to 1.27.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for code.gitea.io/gitea

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-56443, inspect your project dependencies for Gitea:

inspect dependencies for code.gitea.io/gitea

Analyze the terminal output to locate any version of Gitea in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.27.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Gitea, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary After [PR #37118](https://github.com/go-gitea/gitea/pull/37118) / **CVE-2026-25714** (`fix: Unify public-only token filtering in API queries and repo access checks`, merged 2026-05-18, backport `#37773` to 1.26.2 — the May 2026 unification pass for public-only token filtering, reporter Medoedus per the 1.26.2 release notes), the `public-only` PAT scope is still bypassable on **Repository** and **Package** scope categories when the owner's `Visibility = Limited` (instance-internal). The sibling `Org` / `User` / `ActivityPub` cases in the same `checkTokenPublicOnly` switch correctly reject Limited owners via `!Visibility.IsPublic()`. The Repository / Package cases use `repo.IsPrivate` or `Owner.Visibility.IsPrivate()`, both of which return `false` for `VisibleTypeLimited` — so a `public-only` PAT strictly exceeds anonymous reach on a Limited owner. Tested on `gitea/gitea:1.26.2`. The decisive marker is that PR #37118's unification IS applied in the version under test (User-category PROBE returns `403 "token scope is limited to public users"`). Despite that, the Repository-category PROBE on the same Limited owner with the same PAT returns `200` and serves content. ## Affected entry points (4 spots) | File:Line | Function | Affected surface | |---|---|---| | `routers/api/v1/api.go:292` | `checkTokenPublicOnly` Package case | API v1 packages | | `routers/api/packages/api.go:76` | `reqPackageAccess` middleware | All 24 native package registries (`/api/packages/<type>/...`) | | `services/context/api.go` | `TokenCanAccessRepo` helper | All API v1 Repository-category endpoints — content, issues, PRs, releases, labels, milestones, etc. | | `services/context/permission.go:32` | `CheckTokenScopes` (called via `CheckRepoScopedToken`) | Web download endpoints `/raw`, `/media`, `/attachments`. LFS routes (`services/lfs/server.go:470/472`, `services/lfs/locks.go:62/151/216/284`) also chain through this helper. | All four sinks check `repo.IsPrivate` or `Owner.Visibility.IsPrivate()` only. `VisibleTypeLimited` falls through. ```go // modules/structs/visible_type.go func (vt VisibleType) IsPrivate() bool { return vt == VisibleTypePrivate } // line 39-40 func (vt VisibleType) IsLimited() bool { return vt == VisibleTypeLimited } // line 33-34 ``` ## Same-file evidence (`routers/api/v1/api.go:246-299` after PR #37118) ```go case auth_model.AccessTokenScopeCategoryOrganization: orgPrivate := ... && !ctx.Org.Organization.Visibility.IsPublic() // !IsPublic ✓ case auth_model.AccessTokenScopeCategoryUser: if ... && !ctx.ContextUser.Visibility.IsPublic() { ... } // !IsPublic ✓ case auth_model.AccessTokenScopeCategoryActivityPub: if ... && !ctx.ContextUser.Visibility.IsPublic() { ... } // !IsPublic ✓ case auth_model.AccessTokenScopeCategoryPackage: if ctx.Package != nil && ctx.Package.Owner.Visibility.IsPrivate() { // IsPrivate ONLY ✗ ctx.APIError(http.StatusForbidden, "token scope is limited to public packages") return } ``` `TokenCanAccessRepo` (`services/context/api.go`) reduces to `!repo.IsPrivate`: ```go // A public-only token cannot reach a private repo; any other token is unrestricted by this check. func (ctx *APIContext) TokenCanAccessRepo(repo *repo_model.Repository) bool { return repo == nil || !ctx.PublicOnly || !repo.IsPrivate } ``` `CheckTokenScopes` (`services/context/permission.go:32`): ```go if publicOnly && repo != nil && repo.IsPrivate { ctx.HTTPError(http.StatusForbidden) return } ``` ## PoC (Docker e2e VERIFIED on `gitea/gitea:1.26.2`, 2026-06-05) Full script in the report (`run-poc.sh`). Setup: 1. Create user `limuser`. `PATCH /api/v1/admin/users/limuser` with body `{"visibility":"limited", ...}` — response confirms `"visibility":"limited"`. 2. Upload a generic package as `limuser`: `PUT /api/packages/limuser/generic/secretpkg/1.0.0/secret.txt` with body `secret-content-internal-only` → `201`. 3. Create user `attacker`. 4. Mint PAT for `attacker` with `scopes=["read:package","read:user","read:repository","public-only"]`. Result on `gitea/gitea:1.26.2` — nine PROBEs: ``` PROBE A (download package via attacker PAT) HTTP=200 Body: secret-content-internal-only PROBE C (read README of limuser's PUBLIC repo) HTTP=200 Body: {"name":"README.md", ...} PROBE F (sanity — User category, same PAT, same owner) HTTP=403 Body: {"message":"token scope is limited to public users"} PROBE G (Repository category, same PAT, same owner) HTTP=200 Body: {"name":"README.md", ...} ← bypass PROBE H (list limuser's repos, User category) HTTP=403 Body: {"message":"token scope is limited to public users"} PROBE M (git HTTPS smart protocol — info/refs) HTTP=200 Body: 001e# service=git-upload-pack ... HEAD ... ← full clone enabled PROBE N (write attempt: POST contents/hacked.txt) HTTP=403 Body: {"message":"user should have a permission to write to the target branch"} Integrity:N confirmed PROBE O (Limited ORG — same bypass class) Org category : HTTP=403 {"message":"token scope is limited to public orgs"} Repo category : HTTP=200 README content ← bypass Anonymous baseline (no auth) on every above endpoint: HTTP=401/404 ``` Gitea's own server error string in PROBE F / H / O — *"token scope is limited to public users"* / *"public orgs"* — is the explicit declaration of intent. Repository / Package category violates that intent on the same Limited owner. ## Why this is not a duplicate of CVE-2026-25714 CVE-2026-25714 / PR #37118 (the May 2026 unification pass for public-only token filtering, merged 2026-05-18, backported to 1.26.2 via PR #37773) realigned `checkTokenPublicOnly`'s Org / User / ActivityPub cases on `!Visibility.IsPublic()` and introduced the `TokenCanAccessRepo` helper for the Repository / Issue / Notification cases. PROBE F on `1.26.2` returns `403 "token scope is limited to public users"` for the User category — i.e. PR #37118's unification IS in effect on the version under test. The Repository / Package leak occurs *after* that fix; the Limited gap is the next residual issue on the same hygiene effort (the Package case was not touched, and `TokenCanAccessRepo` reduces to `!repo.IsPrivate` without consulting owner visibility), not the same bug. ## Suggested fix (4 spots, 1-line shape each) ```go // routers/api/v1/api.go:292 (checkTokenPublicOnly Package case) - if ctx.Package != nil && ctx.Package.Owner.Visibility.IsPrivate() { + if ctx.Package != nil && !ctx.Package.Owner.Visibility.IsPublic() { // routers/api/packages/api.go:76 (reqPackageAccess middleware) - if ctx.Package != nil && ctx.Package.Owner.Visibility.IsPrivate() { + if ctx.Package != nil && !ctx.Package.Owner.Visibility.IsPublic() { // services/context/api.go (TokenCanAccessRepo helper) - return repo == nil || !ctx.PublicOnly || !repo.IsPrivate + return repo == nil || !ctx.PublicOnly || + (!repo.IsPrivate && repo.Owner != nil && repo.Owner.Visibility.IsPublic()) // services/context/permission.go:32 (CheckTokenScopes) - if publicOnly && repo != nil && repo.IsPrivate { + if publicOnly && repo != nil && + (repo.IsPrivate || (repo.Owner != nil && !repo.Owner.Visibility.IsPublic())) { ``` This aligns the Repository / Package categories with the User / Org / ActivityPub siblings already shipped in PR #37118. ## Reporter JebeenLee

CVE-2026-56443 Affected Gitea Versions

2 component(s)
Fixed Versions:
1.27.0
Product / Package Ecosystem Affected Versions Fixed Version
code.gitea.io/gitea
Go
< 1.27.0
1.27.0
gitea.dev
Go
< 1.27.0
1.27.0

References

Frequently Asked Questions

What is CVE-2026-56443?
CVE-2026-56443 is a security vulnerability in Gitea involving Token public-only scope bypassed on Limited-visibility owners (Repository + Package categories) — residual after CVE-2026-25714 / PR #37118 under CWE-863: Incorrect Authorization.
Which Gitea versions are affected?
Affected versions include releases prior to 1.27.0 across affected packages: code.gitea.io/gitea, gitea.dev.
What version fixes CVE-2026-56443?
Upgrading to 1.27.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is code.gitea.io/gitea affected?
Yes, code.gitea.io/gitea is affected in releases prior to 1.27.0. Upgrade your dependency to 1.27.0 or later.
Is gitea.dev affected?
Yes, gitea.dev is affected in releases prior to 1.27.0. Upgrade your dependency to 1.27.0 or later.
What is the CVSS score of CVE-2026-56443?
CVE-2026-56443 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-56443?
CVE-2026-56443 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for CVE-2026-56443?
Run the dependency tree command: 'inspect dependencies for code.gitea.io/gitea'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7p4h-3gxq-x3h3",
  "modified" : "2026-09-24T15:53:00Z",
  "published" : "2026-07-21T20:17:19Z",
  "aliases" : [ "CVE-2026-56443" ],
  "summary" : "Gitea: Token public-only scope bypassed on Limited-visibility owners (Repository + Package categories) — residual after CVE-2026-25714 / PR #37118",
  "details" : "## Summary\n\nAfter [PR #37118](https://github.com/go-gitea/gitea/pull/37118) / **CVE-2026-25714**\n(`fix: Unify public-only token filtering in API queries and repo access checks`,\nmerged 2026-05-18, backport `#37773` to 1.26.2 — the May 2026 unification pass\nfor public-only token filtering, reporter Medoedus per the 1.26.2 release notes),\nthe `public-only` PAT scope is still bypassable on **Repository** and **Package**\nscope categories when the owner's `Visibility = Limited` (instance-internal).\n\nThe sibling `Org` / `User` / `ActivityPub` cases in the same `checkTokenPublicOnly`\nswitch correctly reject Limited owners via `!Visibility.IsPublic()`. The\nRepository / Package cases use `repo.IsPrivate` or `Owner.Visibility.IsPrivate()`,\nboth of which return `false` for `VisibleTypeLimited` — so a `public-only` PAT\nstrictly exceeds anonymous reach on a Limited owner.\n\nTested on `gitea/gitea:1.26.2`. The decisive marker is that PR #37118's\nunification IS applied in the version under test (User-category PROBE returns\n`403 \"token scope is limited to public users\"`). Despite that, the\nRepository-category PROBE on the same Limited owner with the same PAT returns\n`200` and serves content.\n\n## Affected entry points (4 spots)\n\n| File:Line | Function | Affected surface |\n|---|---|---|\n| `routers/api/v1/api.go:292` | `checkTokenPublicOnly` Package case | API v1 packages |\n| `routers/api/packages/api.go:76` | `reqPackageAccess` middleware | All 24 native package registries (`/api/packages/<type>/...`) |\n| `services/context/api.go` | `TokenCanAccessRepo` helper | All API v1 Repository-category endpoints — content, issues, PRs, releases, labels, milestones, etc. |\n| `services/context/permission.go:32` | `CheckTokenScopes` (called via `CheckRepoScopedToken`) | Web download endpoints `/raw`, `/media`, `/attachments`. LFS routes (`services/lfs/server.go:470/472`, `services/lfs/locks.go:62/151/216/284`) also chain through this helper. |\n\nAll four sinks check `repo.IsPrivate` or `Owner.Visibility.IsPrivate()` only.\n`VisibleTypeLimited` falls through.\n\n```go\n// modules/structs/visible_type.go\nfunc (vt VisibleType) IsPrivate() bool { return vt == VisibleTypePrivate }   // line 39-40\nfunc (vt VisibleType) IsLimited() bool { return vt == VisibleTypeLimited }   // line 33-34\n```\n\n## Same-file evidence (`routers/api/v1/api.go:246-299` after PR #37118)\n\n```go\ncase auth_model.AccessTokenScopeCategoryOrganization:\n    orgPrivate := ... && !ctx.Org.Organization.Visibility.IsPublic()        // !IsPublic ✓\ncase auth_model.AccessTokenScopeCategoryUser:\n    if ... && !ctx.ContextUser.Visibility.IsPublic() { ... }                // !IsPublic ✓\ncase auth_model.AccessTokenScopeCategoryActivityPub:\n    if ... && !ctx.ContextUser.Visibility.IsPublic() { ... }                // !IsPublic ✓\n\ncase auth_model.AccessTokenScopeCategoryPackage:\n    if ctx.Package != nil && ctx.Package.Owner.Visibility.IsPrivate() {     // IsPrivate ONLY ✗\n        ctx.APIError(http.StatusForbidden, \"token scope is limited to public packages\")\n        return\n    }\n```\n\n`TokenCanAccessRepo` (`services/context/api.go`) reduces to `!repo.IsPrivate`:\n\n```go\n// A public-only token cannot reach a private repo; any other token is unrestricted by this check.\nfunc (ctx *APIContext) TokenCanAccessRepo(repo *repo_model.Repository) bool {\n    return repo == nil || !ctx.PublicOnly || !repo.IsPrivate\n}\n```\n\n`CheckTokenScopes` (`services/context/permission.go:32`):\n\n```go\nif publicOnly && repo != nil && repo.IsPrivate {\n    ctx.HTTPError(http.StatusForbidden)\n    return\n}\n```\n\n## PoC (Docker e2e VERIFIED on `gitea/gitea:1.26.2`, 2026-06-05)\n\nFull script in the report (`run-poc.sh`). Setup:\n\n1. Create user `limuser`. `PATCH /api/v1/admin/users/limuser` with body\n   `{\"visibility\":\"limited\", ...}` — response confirms `\"visibility\":\"limited\"`.\n2. Upload a generic package as `limuser`:\n   `PUT /api/packages/limuser/generic/secretpkg/1.0.0/secret.txt` with body\n   `secret-content-internal-only` → `201`.\n3. Create user `attacker`.\n4. Mint PAT for `attacker` with `scopes=[\"read:package\",\"read:user\",\"read:repository\",\"public-only\"]`.\n\nResult on `gitea/gitea:1.26.2` — nine PROBEs:\n\n```\nPROBE A  (download package via attacker PAT)\n    HTTP=200  Body: secret-content-internal-only\n\nPROBE C  (read README of limuser's PUBLIC repo)\n    HTTP=200  Body: {\"name\":\"README.md\", ...}\n\nPROBE F  (sanity — User category, same PAT, same owner)\n    HTTP=403  Body: {\"message\":\"token scope is limited to public users\"}\n\nPROBE G  (Repository category, same PAT, same owner)\n    HTTP=200  Body: {\"name\":\"README.md\", ...}                    ← bypass\n\nPROBE H  (list limuser's repos, User category)\n    HTTP=403  Body: {\"message\":\"token scope is limited to public users\"}\n\nPROBE M  (git HTTPS smart protocol — info/refs)\n    HTTP=200  Body: 001e# service=git-upload-pack ... HEAD ...   ← full clone enabled\n\nPROBE N  (write attempt: POST contents/hacked.txt)\n    HTTP=403  Body: {\"message\":\"user should have a permission to write to the target branch\"}\n                                                                    Integrity:N confirmed\n\nPROBE O  (Limited ORG — same bypass class)\n    Org category    : HTTP=403  {\"message\":\"token scope is limited to public orgs\"}\n    Repo category   : HTTP=200  README content                  ← bypass\n\nAnonymous baseline (no auth) on every above endpoint: HTTP=401/404\n```\n\nGitea's own server error string in PROBE F / H / O — *\"token scope is limited\nto public users\"* / *\"public orgs\"* — is the explicit declaration of intent.\nRepository / Package category violates that intent on the same Limited owner.\n\n## Why this is not a duplicate of CVE-2026-25714\n\nCVE-2026-25714 / PR #37118 (the May 2026 unification pass for public-only token\nfiltering, merged 2026-05-18, backported to 1.26.2 via PR #37773) realigned\n`checkTokenPublicOnly`'s Org / User / ActivityPub cases on `!Visibility.IsPublic()`\nand introduced the `TokenCanAccessRepo` helper for the Repository / Issue /\nNotification cases.\n\nPROBE F on `1.26.2` returns `403 \"token scope is limited to public users\"` for\nthe User category — i.e. PR #37118's unification IS in effect on the version\nunder test. The Repository / Package leak occurs *after* that fix; the Limited\ngap is the next residual issue on the same hygiene effort (the Package case was\nnot touched, and `TokenCanAccessRepo` reduces to `!repo.IsPrivate` without\nconsulting owner visibility), not the same bug.\n\n## Suggested fix (4 spots, 1-line shape each)\n\n```go\n// routers/api/v1/api.go:292  (checkTokenPublicOnly Package case)\n- if ctx.Package != nil && ctx.Package.Owner.Visibility.IsPrivate() {\n+ if ctx.Package != nil && !ctx.Package.Owner.Visibility.IsPublic() {\n\n// routers/api/packages/api.go:76  (reqPackageAccess middleware)\n- if ctx.Package != nil && ctx.Package.Owner.Visibility.IsPrivate() {\n+ if ctx.Package != nil && !ctx.Package.Owner.Visibility.IsPublic() {\n\n// services/context/api.go  (TokenCanAccessRepo helper)\n- return repo == nil || !ctx.PublicOnly || !repo.IsPrivate\n+ return repo == nil || !ctx.PublicOnly ||\n+     (!repo.IsPrivate && repo.Owner != nil && repo.Owner.Visibility.IsPublic())\n\n// services/context/permission.go:32  (CheckTokenScopes)\n- if publicOnly && repo != nil && repo.IsPrivate {\n+ if publicOnly && repo != nil &&\n+     (repo.IsPrivate || (repo.Owner != nil && !repo.Owner.Visibility.IsPublic())) {\n```\n\nThis aligns the Repository / Package categories with the User / Org / ActivityPub\nsiblings already shipped in PR #37118.\n## Reporter\n\nJebeenLee",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "code.gitea.io/gitea"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.27.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gitea.dev"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.27.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/security/advisories/GHSA-7p4h-3gxq-x3h3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-56443"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/commit/de4b8277e9cb576f2315fb03b5ab6478b42a1d31"
  }, {
    "type" : "WEB",
    "url" : "https://blog.gitea.com/gitea-1.27.0-is-released"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-gitea/gitea"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/releases/tag/v1.27.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-21T20:17:19Z",
    "nvd_published_at" : "2026-08-13T17:17:25Z"
  }
}