Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2025-68697

Self-hosted n8n has Legacy Code node that enables arbitrary file read/write
Back to all
CVE

CVE-2025-68697

Self-hosted n8n has Legacy Code node that enables arbitrary file read/write

Impact

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. However, this does not restrict access to other parts of the filesystem unless additional file access limitations are configured.

Patches

  • 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.

Workarounds

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.

Resources

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
7.1
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N
C
H
U
7.1
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N

Related Resources

No items found.

References

https://github.com/n8n-io/n8n/security/advisories/GHSA-j4p8-h8mh-rh8q, https://nvd.nist.gov/vuln/detail/CVE-2025-68697, https://github.com/n8n-io/n8n

Severity

7.1

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
7.1
EPSS Probability
0.00041%
EPSS Percentile
0.12419%
Introduced Version
1.2.1,1.16.0,1.2.0
Fix Available
2.0.0,2.0.0-rc.0

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading