UTC
High

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
What it is

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.

What to do

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 upgrade yet

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.

Affected
PackageRegistryAffectedFixed in
n8nnpm>= 1.2.1, < 2.0.02.0.0

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.

Sources: GitHub Advisory Database, reviewed and malware advisories (CC BY 4.0, https://github.com/advisories); advisories published by Cursor (https://github.com/cursor/cursor/security/advisories); advisories published by OpenClaw (https://github.com/openclaw/openclaw/security/advisories); advisories published by vLLM (https://github.com/vllm-project/vllm/security/advisories); advisories published by Open WebUI (https://github.com/open-webui/open-webui/security/advisories); advisories published by n8n (https://github.com/n8n-io/n8n/security/advisories); advisories published by Flowise (https://github.com/FlowiseAI/Flowise/security/advisories); advisories published by Langflow (https://github.com/langflow-ai/langflow/security/advisories); advisories published by the MCP Python SDK project (https://github.com/modelcontextprotocol/python-sdk/security/advisories); advisories published by MLflow (https://github.com/mlflow/mlflow/security/advisories); CISA Known Exploited Vulnerabilities catalog (CC0). Data as of 2026-11-22. ShieldMap describes how each problem works and how to fix it; it does not publish exploit code. Report a correction to [email protected].