highCVE-2026-86081Sep 10, 2026

CVE-2026-86081: n8n Regular Expression Denial of Service via Git Node Clone Path

Pranav Khune
Penetration Testing Team Lead, SecureLayer7

A crafted clone destination path fed to n8n's Git node triggers catastrophic backtracking in the default file-block regex, letting any authenticated user freeze the entire n8n instance with a single…

Packagen8n
Ecosystemnpm
Affected< 1.123.76
Fixed in1.123.76
CVE-2026-86081: n8n Regular Expression Denial of Service via Git Node Clone Path

The problem

The Git node's clone operation validates the user-supplied destination path against the default N8N_BLOCK_FILE_PATTERNS regular expression. That default, declared in packages/@n8n/config/src/configs/security.config.ts, contained nested quantifiers that allowed catastrophic backtracking.

Because the match runs synchronously on the main n8n process, a single crafted path can peg the event loop at 100% CPU indefinitely. Any authenticated workflow editor can trigger this, no special permissions or unusual configuration required.

Proof of concept

A working proof-of-concept for CVE-2026-86081 in n8n, with the exact payload below.

javascript
// Set the Git node "Clone" destination path to this value in a workflow:
./x.git/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x!

The vulnerable default pattern is ^(./).git(/.*)*$. The inner group (/.*)* combines a repeated outer quantifier with a greedy inner .* that itself matches /. When the engine tries to decide how to split a long sequence of /x tokens between the outer and inner quantifiers and ultimately fails to match the trailing !, it must explore an exponential number of combinations before giving up.

The root cause is CWE-1333: a polynomial or exponential blowup caused by nested, overlapping quantifiers on the same character class. The fix rewrites the pattern so each character in the path is consumed at most once, making match time linear regardless of input length.

The fix

Upgrade to n8n 1.123.76, 2.37.7, or 2.38.2. The patch rewrites the N8N_BLOCK_FILE_PATTERNS default in packages/@n8n/config/src/configs/security.config.ts to eliminate nested quantifiers. If you cannot upgrade immediately, set NODES_EXCLUDE=n8n-nodes-base.git to disable the Git node, or replace N8N_BLOCK_FILE_PATTERNS with a backtracking-safe equivalent pattern.

Reported by csuermann.

References: [1][2][3][4][5][6]

Related research