Skip to content
HighVulnerability

GHSA-j4p8-h8mh-rh8q: Self-hosted n8n has Legacy Code node that enables arbitrary file read/write

Published
Record updated
View JSON
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.