GITEA.DEV · CVE-2026-120725 · Package
FIX → 28.4.0
On Gitea instances with REQUIRE_SIGNIN_VIEW enabled, the Git LFS routes still serve objects from non-private repositories to clients with no account. An attacker who knows the owner/repo path and an object's SHA-256 can download that file anonymously.
first public Nov 15, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Instances that set REQUIRE_SIGNIN_VIEW to true and serve Git LFS objects from non-private repositories of public owners. Instances without that setting, or with LFS disabled, are not exposed. Private repositories and those of limited or private owners are not reachable.
Not affected if default-config, lfs-disabled, private-repos-only
Who cares git-lfs, gitea, self-hosted
[service] section of app.ini for REQUIRE_SIGNIN_VIEW = true and LFS_START_SERVER = true.gitea --version; versions <= 28.3.0 are affected.LFS_ALLOW_PURE_SSH = true, the SSH LFS path is also affected.On an instance with [service] REQUIRE_SIGNIN_VIEW = true, the Git LFS routes still serve objects to clients with no account. Anyone who knows a non-private repository's owner/repo path and a file's SHA-256 can download that LFS object with GET /{owner}/{repo}.git/info/lfs/objects/{oid}. The web UI, the API and git clone all refuse the same client. The attached reproducer sets up alice's non-private repository alice/firmware with one LFS file, shows the anonymous API request getting 403 and info/refs getting 401, and then shows the anonymous LFS GET returning 200 with exactly the bytes alice downloads with her own credentials.
The cause is authenticate() in services/lfs/server.go, reached with requireSigned = false from the download, batch, upload and verify handlers. It returns early when the anonymous doer's permission allows reading. The permission model grants AccessModeRead to a nil user on any non-private repository of a public owner, and it only consults REQUIRE_SIGNIN_VIEW for restricted users. The LFS routes are registered with , which carries no , so nothing on the LFS path checks the setting. The other read paths (web, API, git smart HTTP, SSH, packages) each check it at their own entry point.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
Upgrade to 28.4.0
28.4.0optSignInFromAnyOriginSignInRequiredThe batch route with "operation": "download" also tells an anonymous client whether a given OID is stored in a repository, even without the correct size, since a wrong size returns 422. The attacker cannot discover paths or hashes from the instance; they must come from outside, for example LFS pointer files in a leaked or mirrored checkout or a published checksum. Private repositories and repositories of limited or private owners are not reachable, and write and lock operations still return 401.
With LFS_ALLOW_PURE_SSH = true, a restricted user or a deploy key of another repository can reach the same objects through git-lfs-transfer. This is a second route to the same anonymous read, closed by the same one-line fix. The early return dates from bbad9b6178 (#5912, 2019). This is the LFS counterpart of the gaps already closed for packages (#20873) and the container registry (#28877).
The Git LFS routes do not honour [service] REQUIRE_SIGNIN_VIEW = true. A client without any credential downloads LFS
objects from non-private repositories of an instance that otherwise refuses every anonymous read.
31626de2a6cdd3e1fe93216e4ac80f511297f1e7.owner/repo and the SHA-256 (OID) of the object.REQUIRE_SIGNIN_VIEW = true (default false; it is the setting being bypassed) and
LFS_START_SERVER = true (code default false; the web installer writes true, routers/install/install.go:332).GET /{owner}/{repo}.git/info/lfs/objects/{oid} and POST /{owner}/{repo}.git/info/lfs/objects/batch.On such an instance, for the non-private repository alice/firmware and with no Authorization header or cookie:
GET /api/v1/repos/alice/firmware -> 403
GET /alice/firmware.git/info/refs?service=git-upload-pack -> 401
GET /alice/firmware.git/info/lfs/objects/<sha256 of the file> -> 200, the file
Every other read path enforces the setting at its own entry point: the web routes through optSignIn
(SignInRequired: setting.Service.RequireSignInViewStrict, routers/web/web.go:348), the API through
verifyAuthWithOptionsAPI (routers/api/v1/api.go:1022), packages in determineAccessMode
(services/context/package.go:113), SSH in ServCommand (routers/private/serv.go:245), and git smart HTTP with
// routers/web/repo/githttp.go:129
// Only public pulls don't need auth: repo must exist, not require-sign-in
canAnonymousPull := false
if isPull && repoExist && !setting.Service.RequireSignInViewStrict {
The LFS routes have no counterpart. They are registered with optSignInFromAnyOrigin, whose VerifyOptions carry no
SignInRequired, because LFS authenticates inside its handlers:
// routers/web/web.go:325
var optSignInFromAnyOrigin = verifyAuthWithOptionsWeb(&common.VerifyOptions{DisableCrossOriginProtection: true})
// routers/web/web.go:1764
common.AddOwnerRepoGitLFSRoutes(m, lfsServerEnabled, webAuth.AllowBasic, webAuth.AllowDeployToken, repo.CorsHandler(), optSignInFromAnyOrigin)
The handlers reach authenticate through getAuthenticatedRepository, which passes requireSigned = false
(services/lfs/server.go:470) for the download, batch, upload and verify routes. authenticate returns early on the
permission of the anonymous doer:
// services/lfs/server.go:550
// it works for both anonymous request and signed-in user, then perm.CanAccess will do the permission check
perm, err := access_model.GetDoerRepoPermission(ctx, repository, ctx.Doer) // ctx.Doer == nil
…
canAccess := perm.CanAccess(accessMode, unit.TypeCode)
// if it doesn't require sign-in and anonymous user has access, return true
…
if canAccess && (!requireSigned || ctx.IsSigned) {
return true
}
The comment assumes the permission check covers the anonymous case, but the permission model does not know about the
setting for a nil doer: GetIndividualUserRepoPermission returns AccessModeRead for user == nil on any non-private
repository whose owner is public (models/perm/access/repo_permission.go:465-468). The setting is only consulted there
for restricted users (models/perm/access/access.go:52). So with no credentials canAccess is true for a read,
requireSigned is false, and the bearer-token check below is never reached. This early return is long-standing, not a
recent regression: it dates from bbad9b6178 ("Fix bug when read public repo lfs file", #5912, 2019-01-31).
DownloadHandler (services/lfs/server.go:117) then streams the object. BatchHandler (:192) with
"operation": "download" answers per OID: a download action for an object the repository has, "error": {"code": 404}
for one it does not have, which lets the same client test whether a given file is stored in a given repository. The
size need not be known for this: a wrong size for a stored object is answered with 422 "Object <oid> is not N bytes"
(services/lfs/server.go:254), which also confirms presence. The
routes that need write access (batch with upload, PUT, verify) and the lock routes (requireSigned = true,
services/lfs/locks.go:67) answer 401 to the anonymous client.
Presenting credentials can reduce access on the same URL: a restricted user (gitea admin user create --restricted)
who sends Basic auth gets 401 for the GET above, because the restricted user's permission honours the setting; without
the header the answer is 200.
The same shortcut is reachable over pure-SSH LFS (LFS_ALLOW_PURE_SSH = true, default false). The internal LFS
routes build a web context that never has a doer (routers/private/internal.go:105-108), and GiteaBackend.Download
requests whatever {owner}/{repo}.git/info/lfs/… path the client put into the id argument
(modules/lfstransfer/backend/backend.go:185). This was exercised against the built-in SSH server, separately from the
shipped reproducer: a restricted user, and a read-only deploy key of bob/tool, are both refused
git-lfs-transfer alice/pub.git download ("has no "read" permission for alice/pub"), but inside a
git-lfs-transfer session on their own repository the packets get-object <oid> /
id=base64({"download":{"href":"http://x/alice/pub.git/info/lfs/objects/<oid>"}}) return status 200 and the file of
alice/pub. The session's LFS token is bound to the other repository and is never examined. This is a second route to
the same anonymous read, not an additional capability: the same person can send the anonymous HTTP request above. The
same fix closes both.
The attacker needs no account, but must already know the repository path and the exact SHA-25
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.