Sep 10, 2026·5 min read·14 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 authorization bypass vulnerability in Vikunja versions prior to v2.6.0 permits authenticated users to delete relationships between tasks across project boundaries without requiring read or write authorization for the target related task.
A path traversal vulnerability in Shiny for Python (posit-dev/py-shiny) versions 1.4.0 through 1.6.3 allows unauthenticated remote attackers to read arbitrary files and traverse directories via crafted _state_id_ query parameters.
A Stored Cross-Site Scripting vulnerability in @tinacms/web-components prior to version 0.2.1 allows low-privileged content authors to execute arbitrary JavaScript code in the context of website visitors via unsanitized URL attributes in custom Markdown rendering components.
A critical origin validation flaw in TinaCMS admin preview allows unauthenticated attackers to bypass cross-origin postMessage checks and execute unauthorized GraphQL queries and mutations under an authenticated editor's context.
@tinacms/cli prior to version 3.0.0 dynamically constructs client source files using string interpolation without properly sanitizing runtime configuration variables. An attacker with permissions to create a branch or pull request can inject arbitrary JavaScript statements via a crafted Git ref name, leading to execution during automated build processes.
Nginx UI versions 2.2.0 through 2.5.10 fail to properly configure Gin framework trusted proxies when deployed behind a reverse proxy. This causes all incoming HTTP requests to be attributed to the loopback IP (127.0.0.1), enabling IP allowlist bypass and global authentication lockouts.