Sep 10, 2026·5 min read·4 visits
An authenticated user with workflow editing privileges can trigger exponential backtracking in n8n's file validation regular expression, blocking the single-threaded Node.js event loop and rendering the entire instance unavailable.
A Regular Expression Denial of Service (ReDoS) vulnerability exists in n8n due to inefficient validation in its default blocked-file-pattern matching mechanism. This flaw can be triggered during Git operations, allowing authenticated workflow editors to cause resource exhaustion and completely freeze the n8n application process.
The vulnerability is located in the default file-blocking pattern validation mechanism of the n8n workflow automation platform. This mechanism restricts nodes from accessing or modifying sensitive directories on the filesystem. Nodes that process user-defined paths, such as the Git node during a repository clone operation, evaluate paths against this blocklist before executing system commands.
The target validation pattern is defined globally via the N8N_BLOCK_FILE_PATTERNS configuration. Under the default configuration, paths are parsed synchronously using JavaScript's native RegExp engine. Because this engine is embedded within Node.js, any extensive computation occurring during execution blocks the single-threaded event loop, preventing the server from handling other asynchronous operations.
An attacker with permissions to design or edit workflows can configure a Git node to point to a crafted path containing multiple nested directories. This triggers a worst-case validation scenario where the regular expression evaluation stalls. The resulting execution freeze blocks all concurrent workflows, API routes, and administrative functions.
The underlying vulnerability is classified as CWE-1333: Inefficient Regular Expression Complexity. The application defines a default regular expression pattern meant to block access to specific directories such as .git. The vulnerable pattern was configured as ^(.*/)*.git(/.*)$ in the system's security configuration.
This expression contains nested and overlapping quantifiers inside the leading prefix capture group (.*/)*. Within this group, the subpattern .* matches any characters (including slashes) zero or more times, while the outer grouping * allows this entire segment to repeat. Because multiple combinations of the same input sequence can satisfy both the inner and outer quantifiers, the parser experiences extreme ambiguity.
When evaluated against a path consisting of multiple slash characters that does not terminate in a match for .git, the engine executes exponential backtracking. It attempts to evaluate all $2^{N-1}$ possible ways to partition the string, where $N$ represents the number of directory segments. For input strings with 30 or more nested folders, the evaluation requires hundreds of millions of states, completely starving the processor of CPU cycles.
The vulnerability lies within packages/@n8n/config/src/configs/security.config.ts, where the default configuration for blockFilePatterns is declared. Below is an analysis of the vulnerable and patched patterns.
// VULNERABLE PATTERN
@Env('N8N_BLOCK_FILE_PATTERNS')
blockFilePatterns: string = '^(./)*.git(/.*)$';
// Resolves to: ^(.*/)*.git(/.*)$In the vulnerable pattern, the unescaped dot in .git behaves as a wildcard, compounding the parsing matching states. Furthermore, the nested group (.*/)* matches slashes within slashes, which triggers backtracking when matching fails at the terminal character set.
// PATCHED PATTERN
@Env('N8N_BLOCK_FILE_PATTERNS')
blockFilePatterns: string = '^(?:[^/]*/)*\\.git(?:/.*)?$';
// Resolves to: ^(?:[^/]*/)*\.git(?:/.*)?$The fix introduces three security enhancements to make the regex deterministic. First, it replaces .* with [^/]*, meaning the parser can only match non-slash characters within each segment. Second, the dot character in .git is properly escaped as \\.git to ensure a literal match. Third, the terminal wildcard group is rewritten as an optional non-capturing group (?:/.*)? which avoids matching state growth.
Exploitation requires authenticated access to the n8n workflow editor interface, matching the CVSS privilege requirement of 'Low'. The attacker creates a new workflow on the canvas and places a standard Git node. The attack vector specifically targets the Git repository clone path argument parameter.
The attacker configures the Node's action to 'Clone' and inputs a custom repository path. This input path is crafted as a sequence of repeating characters and slashes that intentionally lacks the terminal match required by the expression, such as a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/.
Upon clicking 'Execute Node', the request is transmitted to the n8n backend. The backend processes the parameter and invokes the synchronous regex match. Since JavaScript's engine is single-threaded, the process enters an unresponsive state, causing health check timeouts and terminating handling of any concurrent requests.
The successful exploitation of CVE-2026-86081 causes a complete denial of service (DoS) of the targeted n8n platform. This degrades system availability, impacting scheduled integrations, API integrations, and webhook receivers. For enterprise environments relying on n8n for orchestration, a freeze halts automated workflows across the organization.
The vulnerability is assessed with a CVSS v4.0 score of 7.1. While confidentiality and integrity remain unaffected, the impact to system availability is rated as High. Because the execution blocks the event loop directly, recovery typically requires an administrative restart of the Node.js process or container.
The primary remediation step is upgrading the n8n instance to a patched release. Ensure the software is updated to version 1.123.76, 2.37.7, or 2.38.2 depending on the branch deployed.
If patching is not immediately feasible, system administrators can mitigate the issue by declaring the secure regex via the environment configuration. Setting N8N_BLOCK_FILE_PATTERNS='^(?:[^/]*/)*\.git(?:/.*)?$' inside the n8n environment overwrites the vulnerable default pattern with the hardened expression.
To detect exploitation attempts, monitor system metrics for sustained 100% CPU usage on the n8n Node.js process accompanied by a total drop in HTTP request throughput. Security teams can parse historical database states for workflow definitions containing Git node parameters with repetitive path components.
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
n8n n8n | < 1.123.76 | 1.123.76 |
n8n n8n | >= 2.0.0 < 2.37.7 | 2.37.7 |
n8n n8n | >= 2.38.0 < 2.38.2 | 2.38.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-1333 |
| Attack Vector | Network |
| CVSS v4.0 Score | 7.1 |
| EPSS Score | 0.00322 |
| Exploit Status | poc |
| CISA KEV Status | Not Listed |
The regular expression engine initiates catastrophic backtracking when processing a sequence of directory separators, locking the single-threaded Node.js event loop.
An expression sandbox escape vulnerability exists in n8n due to a missing AST traversal check on ClassBody in the PrototypeSanitizer. This allows authenticated users with low privileges to bypass property checks and achieve remote code execution.
In vulnerable configurations of n8n, the OAuth Dynamic Client Registration endpoint implements field size validation for redirect_uris but fails to enforce proper limits on client_name and grant_types. This allows an unauthenticated remote attacker to submit arbitrarily large values for these fields, leading to persistent database and disk storage exhaustion.
CVE-2025-21587 is a high-severity timing side-channel vulnerability in the Java Secure Socket Extension (JSSE) component of Oracle Java SE and GraalVM. The flaw allows unauthenticated network attackers to perform Bleichenbacher-style (Marvin) decryption oracle attacks, potentially compromising TLS session confidentiality.
CVE-2026-86082 is a critical Server-Side Request Forgery (SSRF) and credential leakage vulnerability in n8n. The flaw exists in the OpenAI Chat Model node's searchModels function, which fails to enforce credential domain restrictions when populating the model dropdown list. This allows an authenticated workflow editor to exfiltrate plaintext OpenAI API keys to an arbitrary attacker-controlled domain by specifying a custom baseURL override.
A high-severity Cross-Site Request Forgery (CSRF) vulnerability exists in the Komari server monitoring tool. The administrative interface sets authentication cookies without restrictive SameSite or Secure attributes, and lacks any CSRF validation, enabling unauthenticated remote attackers to execute arbitrary commands or modify backend settings by exploiting administrative sessions.
An infinite loop vulnerability (CWE-835) in Open WebUI versions 0.5.0 through 0.11.0 allows authenticated attackers to cause a complete and persistent Denial of Service (DoS) of the backend. By submitting a specially crafted chat history containing cyclic message references that omit internal message identifiers, the cycle detection mechanism is bypassed. This triggers an infinite synchronous traversal that blocks the single-threaded asyncio event loop and exhausts system memory, causing the application to crash.