CVE-2025-68697
Privilege Escalation via Code Node in n8n Workflow Platform
Publication date: 2025-12-26
Last updated on: 2025-12-26
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| n8n | n8n | * |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-749 | The product provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted. |
| CWE-269 | The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability affects self-hosted n8n instances running versions prior to 2.0.0 when the Code node operates in legacy JavaScript execution mode. Authenticated users with workflow editing access can invoke internal helper functions within the Code node, allowing them to perform actions on the host system with the same privileges as the n8n process. This includes reading and writing files on the host filesystem, subject to configured file-access restrictions and OS/container permissions. The issue has been fixed in version 2.0.0.
How can this vulnerability impact me? :
The vulnerability can allow an authenticated workflow editor to read sensitive files from the host filesystem or write files to it, potentially leading to unauthorized data access or modification. This could compromise the integrity and confidentiality of data on the host system, depending on the permissions of the n8n process. It may also enable further attacks if sensitive configuration or system files are accessed or altered.
What immediate steps should I take to mitigate this vulnerability?
To mitigate this vulnerability, immediately upgrade n8n to version 2.0.0 or later. If upgrading is not possible right away, apply the following workarounds: limit file operations by setting the environment variable N8N_RESTRICT_FILE_ACCESS_TO to a dedicated directory (e.g., ~/.n8n-files) that contains no sensitive data; ensure N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES is set to true (default) to block access to .n8n and user-defined config files; and disable high-risk nodes such as the Code node using NODES_EXCLUDE if workflow editors are not fully trusted.