Self-hosted n8n has Legacy Code node that enables arbitrary file read/write
CVE-2025-68697 · GHSA-j4p8-h8mh-rh8q · published 2025-12-26 · updated 2025-12-31
- Severity
- High
- CVSS score
- 7.1
- Chance of exploitation (EPSS)
- 0.27%
- Fixed in
- 2.0.0
- Exploitation No known exploitation
- Automatable No
- Technical impact Partial
- CISA SSVC
In self-hosted n8n instances where the Code node runs in legacy (non-task-runner) JavaScript execution mode, authenticated users with workflow editing access can invoke internal helper functions from within the Code node. This allows a workflow editor to perform actions on the n8n host with the same privileges as the n8n process, including: Reading files from the host filesystem (subject to any file-access restrictions configured on the instance and OS/container permissions) Writing files to the host filesystem (subject to the same restrictions) Starting with n8n version 1.2.1, access to files in the n8n home directory (.n8n) is blocked by default.
Upgrade n8n to 2.0.0 or later. If you start it from an MCP config with npx or uvx, pin that version so an old cached copy is not used.
Upgrade to n8n version 2.0.0 or later, where task runners are enabled by default for Code node execution. On n8n version 1.71.0 and above, enable task runners by setting N8NRUNNERSENABLED=true.
If you cannot immediately migrate to task runners: Limit file operations by setting N8NRESTRICTFILEACCESSTO to a dedicated directory (e.g., ~/.n8n-files) and ensure it contains no sensitive data. Keep N8NBLOCKFILEACCESSTON8NFILES=true (default) to block access to .n8n and user-defined config files. If workflow editors are not fully trusted, consider disabling high-risk nodes (including the Code node) using NODES_EXCLUDE.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| n8n | npm | >= 1.2.1, < 2.0.0 | 2.0.0 |
- CriticalMarimo: Pre-Auth Remote Code Execution via Terminal WebSocket Authentication BypassmarimoExploited
- CriticalLangflow CORS misconfiguration enables Account Takeover and RCElangflowExploited
- HighLiteLLM: MCP Authentication Bypass via OAuth2 Passthrough FallbacklitellmExploited
- HighLangflow: IDOR Vulnerability in `/api/v1/responses` Endpoint Allows Authenticated Attackers to Access Another User's FlowlangflowExploited
- CriticalTodoist MCP Server: Browser DNS rebinding lets websites write and delete Todoist data through local MCP server@doist/todoist-mcp
- CriticalLangflow: Unauthenticated Flow Execution via Webhook Authentication Bypasslangflow
- Criticaln8n Vulnerable to Remote Code Execution via Expression Injectionn8n, n8nExploited
- Criticaln8n Has an Arbitrary File Read via Git Noden8n, n8n, n8n
- Criticaln8n: HTTP Request Node Pagination Prototype Pollution to RCEn8n, n8n, n8n
- Criticaln8n Has an XML Node Prototype Pollution Patch Bypassn8n, n8n, n8n
- Criticaln8n has XML Node Prototype Pollution that to RCEn8n, n8n, n8n
- Criticaln8n has Prototype Pollution in XML Webhook Body Parser that Leads to RCEn8n, n8n, n8n
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.