CVE-2025-68697: n8n Arbitrary File Read/Write Vulnerability in Legacy Code Node

n8n Updated 26 Dec 2025

Summary

26/12/2025
Yes i
High
7.1

CVE-2025-68697: Self-hosted n8n has Legacy Code node that enables arbitrary file read/write. Affects n8n versions < 2.0.0. Fixed in 2.0.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

n8n is an open-source workflow automation tool that allows users to connect various applications and services through customizable workflows. It features a Code node that enables users to execute JavaScript code within workflows. However, in self-hosted instances running in legacy mode, this Code node can be exploited to perform unauthorized file operations on the host system, posing significant security risks.

Vulnerability Detail

The vulnerability arises in self-hosted n8n instances where the Code node operates in legacy JavaScript execution mode. Authenticated users with workflow editing permissions can invoke internal helper functions, allowing them to read and write files on the host filesystem. While access to the n8n home directory is blocked by default in versions 1.2.1 and above, other filesystem areas remain vulnerable unless additional restrictions are applied. This can lead to unauthorized data exposure and potential system compromise.

How To Fix

Latest published version: 2.44.6 as of 22 Oct 2026

npm install n8n@2.44.6

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.0.0

This is the first release that contains the fix.

npm install n8n@2.0.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate migration to task runners is not feasible, implement the following workarounds: Limit file operations by setting N8N_RESTRICT_FILE_ACCESS_TO to a dedicated directory (e.g., ~/.n8n-files) that contains no sensitive data. Keep N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=true to block access to the .n8n directory and user-defined config files. If workflow editors are not fully trusted, consider disabling high-risk nodes, including the Code node, using the NODES_EXCLUDE environment variable.

Conclusion

CVE-2025-68697 presents a significant security risk for self-hosted n8n instances, allowing unauthorized file access through the Code node. It is crucial to upgrade to the latest version or implement recommended workarounds to mitigate this vulnerability and protect sensitive data.

See every vulnerability recorded for n8n →

Share this vulnerability

FAQ

CVE-2025-68697 is a vulnerability in n8n that allows authenticated users to perform arbitrary file read/write operations through the Code node in legacy execution mode.

If you are using a self-hosted n8n instance with the Code node running in legacy mode, you may be affected. Check your version and execution mode to assess risk.

Exploitation of this vulnerability can lead to unauthorized access to sensitive files on the host filesystem, potentially compromising the entire system.

Upgrade to n8n version 2.0.0 or later, or enable task runners in version 1.71.0 and above. Implement workarounds to limit file access until you can upgrade.

Yes, Vulert can monitor your n8n instance for vulnerabilities using package-lock.json. You can check your application for this vulnerability using the Vulert playground without signing up.

Related vulnerabilities

Recent vulnerabilities recorded for n8n.

How To Fix

Latest published version: 2.44.6 as of 22 Oct 2026

npm install n8n@2.44.6

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.0.0

This is the first release that contains the fix.

npm install n8n@2.0.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback