Vulnerability in code.gitea.io/gitea (CVE-2026-58428)
Summary
Vulnerability in code.gitea.io/gitea (CVE-2026-58428). Data can be tampered with by attackers. Exploitable via PATCH /api/v1/repos/bob/test-repo/releases/1/assets/1. Mitigation: upgrade to 1.27.0 or later.
Original description
The description as published by the source.
Summary
The web handler EditReleasePost (routers/web/repo/release.go) reads form fields with prefix attachment-edit-{uuid} into a map[uuid]newName, passes that map to release_service.UpdateRelease, which writes the new name to the database via repo_model.UpdateAttachmentByUUID WITHOUT calling upload.Verify against setting.Repository.Release.AllowedTypes. The parent CVE-2025-68939 fix (PR #32151) added the equivalent upload.Verify call on the API edit endpoints via attachment_service.UpdateAttachment. The web release edit path was not updated.
A user with repository write permission can rename any existing release attachment to a name with a forbidden extension via the web release edit form, bypassing the operator-configured allowlist.
Details
Vulnerable code
routers/web/repo/release.go:597 EditReleasePost:
const editPrefix = "attachment-edit-"
editAttachments := make(map[string]string)
if setting.Attachment.Enabled {
for k, v := range ctx.Req.Form {
if strings.HasPrefix(k, editPrefix) {
editAttachments[k[len(editPrefix):]] = v[0]
}
}
}
...
if err = release_service.UpdateRelease(ctx, ctx.Doer, ctx.Repo.GitRepo,
rel, addAttachmentUUIDs, delAttachmentUUIDs, editAttachments); err != nil {
ctx.ServerError("UpdateRelease", err)
return
}
services/release/release.go:321 -- the unvalidated write:
for uuid, newName := range editAttachments {
if !deletedUUIDs.Contains(uuid) {…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-58428 has been found in code.gitea.io/gitea.
Attackers can target a specific entry point like PATCH /api/v1/repos/bob/test-repo/releases/1/assets/1 over the network to misuse the product.
Data can be tampered with by attackers. CVSS score: 6.5/10.
What to do: upgrade code.gitea.io/gitea to 1.27.0 or later.
If unsure, ask your IT team or search "code.gitea.io/gitea CVE-2026-58428" on the vendor's site.
CVE-2026-58428 (code.gitea.io/gitea) — CWE-424 / CVSS v3 6.5
Attack vector: remote (network-reachable) / no user interaction
Attack surface: PATCH /api/v1/repos/bob/test-repo/releases/1/assets/1 / POST /bob/test-repo/releases/edit/v0.1 / GET /api/v1/repos/bob/test-repo/releases/1/assets/1 / EditReleasePost
Patched: 1.27.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-424) exists in code.gitea.io/gitea. Attackers reach the vulnerable code path via PATCH /api/v1/repos/bob/test-repo/releases/1/assets/1.
Check the vendor advisory for the affected versions of code.gitea.io/gitea. Attack surface: PATCH /api/v1/repos/bob/test-repo/releases/1/assets/1 / POST /bob/test-repo/releases/edit/v0.1 / GET /api/v1/repos/bob/test-repo/releases/1/assets/1 / EditReleasePost.
Severity: Medium (CVSS 6.5/10). Data can be tampered with by attackers.
Update to 1.27.0.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual PATCH /api/v1/repos/bob/test-repo/releases/1/assets/1 requests with malformed payloads or SQL meta-characters. Run grep -r 'code.gitea.io/gitea' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'code.gitea.io/gitea' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
code.gitea.io/giteaを grep し、稼働しているサービス・バージョンを把握する。 -
2Hunt for indicators of compromise detect
grep 'PATCH /api/v1/repos/bob/test-repo/releases/1/assets/1' /var/log/nginx/access.log | grep -E '(unusual_payload|sqli_pattern)'アクセスログで
PATCH /api/v1/repos/bob/test-repo/releases/1/assets/1への異常なリクエスト (不正な認証ヘッダ・SQLメタ文字)を過去 30〜90日分捜索。WAF/SIEM があれば該当パスのアラート発火履歴を確認。 -
3Apply patch patch
Upgrade code.gitea.io/gitea to 1.27.0ステージング環境で 1.27.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスと、Step 2 で見つけた異常検知の続報チェックを含めること。
-
4Post-deployment verification verify
Replay attack against PATCH /api/v1/repos/bob/test-repo/releases/1/assets/1 on staging to confirm patch closes the vectorパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番では Step 2 と同じログクエリでアラート再発が無いか継続監視。
Affected packages
References
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web blog.gitea.com