{"id":"CVE-2025-68697","aliases":["CVE-2025-68697","GHSA-j4p8-h8mh-rh8q"],"related":[],"kind":"vulnerability","state":"published","title":"Self-hosted n8n has Legacy Code node that enables arbitrary file read/write","summary":"n8n is an open source workflow automation platform. Prior to version 2.0.0, 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), and writing files to the host filesystem (subject to the same restrictions). This issue has been patched in version 2.0.0. Workarounds for this issue involve limiting file operations by setting N8N_RESTRICT_FILE_ACCESS_TO to a dedicated directory (e.g., ~/.n8n-files) and ensure it contains no sensitive data, keeping N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=true (default) to block access to .n8n and user-defined config files, and disabling high-risk nodes (including the Code node) using NODES_EXCLUDE if workflow editors are not fully trusted.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"n8n is an open source workflow automation platform. Prior to version 2.0.0, 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), and writing files to the host filesystem (subject to the same restrictions). This issue has been patched in version 2.0.0. Workarounds for this issue involve limiting file operations by setting N8N_RESTRICT_FILE_ACCESS_TO to a dedicated directory (e.g., ~/.n8n-files) and ensure it contains no sensitive data, keeping N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=true (default) to block access to .n8n and user-defined config files, and disabling high-risk nodes (including the Code node) using NODES_EXCLUDE if workflow editors are not fully trusted.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nIn 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.\n\nThis allows a workflow editor to perform actions on the n8n host with the same privileges as the n8n process, including:\n\n- Reading files from the host filesystem (subject to any file-access restrictions configured on the instance and OS/container permissions)\n- Writing files to the host filesystem (subject to the same restrictions)\n\nStarting with n8n version 1.2.1, access to files in the n8n home directory (`.n8n`) is blocked by default. However, this does not restrict access to other parts of the filesystem unless additional file access limitations are configured.\n\n### Patches\n\n- Upgrade to **n8n version 2.0.0 or later**, where task runners are enabled by default for Code node execution.\n- On **n8n version 1.71.0 and above**, enable task runners by setting `N8N_RUNNERS_ENABLED=true`.\n\n### Workarounds\n\nIf you cannot immediately migrate to task runners:\n\n- Limit file operations by setting `N8N_RESTRICT_FILE_ACCESS_TO` to a dedicated directory (e.g., `~/.n8n-files`) and ensure it contains no sensitive data.\n- Keep `N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=true` (default) to block access to `.n8n` and user-defined config files.\n- If workflow editors are not fully trusted, consider disabling high-risk nodes (including the Code node) using `NODES_EXCLUDE`.\n\n### Resources\n\n- n8n Docs: [Task runners](https://docs.n8n.io/hosting/configuration/task-runners/)\n- n8n Docs: [Task runner environment variables](https://docs.n8n.io/hosting/configuration/environment-variables/task-runners/)\n- n8n Docs: [Security environment variables](https://docs.n8n.io/hosting/configuration/environment-variables/security/#security-environment-variables)\n- n8n Docs: [v2.0 breaking changes](https://docs.n8n.io/2-0-breaking-changes/#enable-task-runners-by-default)","format":"markdown","source":"ghsa"},{"lang":"es","text":"n8n es una plataforma de automatización de flujos de trabajo de código abierto. Antes de la versión 2.0.0, en instancias de n8n autoalojadas donde el nodo Code se ejecuta en modo de ejecución de JavaScript heredado (no task-runner), los usuarios autenticados con acceso de edición de flujos de trabajo pueden invocar funciones auxiliares internas desde dentro del nodo Code. Esto permite a un editor de flujos de trabajo realizar acciones en el host de n8n con los mismos privilegios que el proceso de n8n, incluyendo: leer archivos del sistema de archivos del host (sujeto a cualquier restricción de acceso a archivos configurada en la instancia y permisos de SO/contenedor), y escribir archivos en el sistema de archivos del host (sujeto a las mismas restricciones). Este problema ha sido parcheado en la versión 2.0.0. Las soluciones alternativas para este problema implican limitar las operaciones de archivos configurando N8N_RESTRICT_FILE_ACCESS_TO a un directorio dedicado (p. ej., ~/.n8n-files) y asegurar que no contenga datos sensibles, manteniendo N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=true (predeterminado) para bloquear el acceso a .n8n y archivos de configuración definidos por el usuario, y deshabilitando nodos de alto riesgo (incluyendo el nodo Code) usando NODES_EXCLUDE si los editores de flujos de trabajo no son de plena confianza.","source":"nvd"}],"published":"2025-12-26T18:26:38.000Z","modified":"2026-10-13T09:10:00.323Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":7.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-269","CWE-749"],"affected":[{"ranges":[{"version":"< 2.0.0","status":"affected"}],"vendor":"n8n-io","product":"n8n","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.2.1","status":"affected","fixed":"2.0.0"}],"ecosystem":"npm","package":"n8n","purl":"pkg:npm/n8n","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.0.0"}],"vendor":"n8n","product":"n8n","cpe":"cpe:2.3:a:n8n:n8n:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/n8n-io/n8n/security/advisories/GHSA-j4p8-h8mh-rh8q","tags":["patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-68697","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/n8n-io/n8n","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-12-26T22:00:31.636Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-68697","url":"https://www.cve.org/CVERecord?id=CVE-2025-68697","licence":"CVE Terms of Use","modified":"2025-12-26T22:12:04.529Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-j4p8-h8mh-rh8q","url":"https://github.com/advisories/GHSA-j4p8-h8mh-rh8q","licence":"CC-BY-4.0","modified":"2025-12-31T01:20:40.157Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-68697","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-68697","licence":"Public domain","modified":"2026-10-13T09:10:00.323Z"}],"updatedAt":"2026-11-25T22:59:09.955Z","epss":{"score":0.00284,"percentile":0.22492,"date":"2026-12-02T12:00:21.000Z"}}