CVSS Score: 6.5 Published: 2026-01-23 Full Report: https://cvereports.com/reports/CVE-2026-20904
A classic Insecure Direct Object Reference (IDOR) vulnerability in Gitea versions prior to 1.25.4 allowed authenticated users to toggle the visibility of OpenID credentials belonging to any other user. The flaw stemmed from a database update query that checked the record ID but failed to verify the record owner.
Gitea developers forgot the golden rule of access control: verify ownership. By sending a request to the OpenID visibility toggle endpoint and iterating through IDs, an attacker could hide or show OpenID connections for every user on the instance. The fix involved adding a simple AND uid = ? clause to the SQL query.
- CWE ID: CWE-639
- Attack Vector: Network
- CVSS v3.1: 6.5
- Impact: Integrity Loss
- Privileges Required: Low (Authenticated)
- Exploit Status: PoC Available
- Gitea < 1.25.4
- Gitea: <= 1.25.3 (Fixed in:
1.25.4)
- Scope all database UPDATE/DELETE queries to the authenticated user's ID (e.g.,
WHERE id=? AND user_id=?). - Use UUIDs instead of sequential integers for public-facing resource IDs to prevent enumeration.
- Implement centralized access control checks (middleware) rather than ad-hoc checks in model functions.
Remediation Steps:
- Upgrade Gitea to version 1.25.4 or later.
- If upgrading is impossible, apply the patch from commit ed5720af2ac94d74f822721c05b42b6148ff9c22 manually.
- Restart the Gitea service to apply changes.
Generated by CVEReports - Automated Vulnerability Intelligence