GHSA-j4p8-h8mh-rh8q: Self-hosted n8n has Legacy Code node that enables arbitrary file read/write
- Identifiers
- CVE-2025-68697GHSA-j4p8-h8mh-rh8q
- Published
- Record updated
- Affected
- n8n >= 1.2.1, < 2.0.0
- Fixed in
- 2.0.0
- Known exploitation
- Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
- EPSS
- 0.3%Estimated probability that this CVE is exploited in the next 30 days, from the FIRST Exploit Prediction Scoring System. Read on .
Summary
In self-hosted n8n instances running the Code node in legacy (non-task-runner) JavaScript mode, authenticated users with workflow editing access can invoke internal helper functions. This lets them read and write files on the host with the privileges of the n8n process, subject to any configured file-access restrictions and OS or container permissions. Starting with n8n version 1.2.1, access to the `.n8n` home directory is blocked by default, but other parts of the filesystem remain reachable unless additional limits are configured.
Mitigation
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 `N8N_RUNNERS_ENABLED=true`. If migration is not immediately possible, set `N8N_RESTRICT_FILE_ACCESS_TO` to a dedicated directory (e.g., `~/.n8n-files`) containing no sensitive data, keep `N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=true` (default), and consider disabling the Code node with `NODES_EXCLUDE` if workflow editors are not fully trusted.
Affected packages in the Exposure Registry
Matched by package name and ecosystem. Each entry shows whether the package delegates to a language model and how many tracked packages depend on it.
- n8nnpmLLM dependency since 2026-02-11
Related items
- MediumCVE-2026-143864: InfiniFlow RAGFlow template injection in Canvas StringTransform HandlerSimilar attack, NVD/CVE Database
- MediumCVE-2026-85259: Gemini CLI Triage Flaw Lets Issue Authors Run Code in GitHub ActionsSimilar attack, StepSecurity Blog
- MediumCVE-2026-143967: Wise Chat with AI unauthenticated stored cross-site scriptingSimilar attack, NVD/CVE Database
- MediumCVE-2026-135917: Apache Camel A2A component confused deputy via shared message headersSimilar attack, NVD/CVE Database
- MediumCVE-2026-107489: Improper Authentication vulnerability in Apache Camel A2A component. This issue affects Apache Camel: from 4.21.0…Similar attack, NVD/CVE Database