/

CVE-2026-77068

Severity:

HIGH RISK

(8.8)

Path Traversal (CWE-22) in n8n MCP Schema Node Loader

CVE-2026-77068

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal vulnerability in n8n's MCP node-schema loader allows an authenticated user with global:member privileges to influence which schema module is loaded. By referencing a malicious file through a crafted node type, an attacker may achieve remote code execution in the n8n main process.

Affected context

The vulnerability occurs in n8n deployments that use the MCP node-schema loading workflow and derive schema module paths from node type values. Risk is present when an authenticated user with the required global:member privilege can supply or influence a node type string and the loader does not safely constrain the resulting filesystem path.

Exploit preconditions

  • Attack surface: MCP node-schema loading in the n8n main process
  • Required access: An authenticated account with global:member privileges
  • Trigger point: Processing an attacker-influenced node type during schema module resolution
  • Why exploitation is possible: The loader uses the supplied node type to construct a module path without adequately rejecting path-traversal sequences, allowing unintended local files to be referenced and loaded

Why this happens

The underlying issue is insufficient validation and canonicalization of an attacker-controlled path component. The loader treats a node type string as a trusted module-path fragment without enforcing that the resolved path remains within an intended schema directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, and loading a referenced JavaScript module can extend the impact to code execution.

Potential impact

  • An attacker may execute arbitrary code in the n8n main process
  • The n8n instance could be compromised or altered
  • Credentials, workflow data, and other application secrets could be exposed
  • The attacker could use the process context to access connected services
  • Workflows or integrations could be modified for persistence or data theft

General mitigation guidance

Mitigation generally focuses on eliminating filesystem path decisions based directly on untrusted node type values.

Common defensive patterns include:

  • Resolve schema modules through a fixed allowlist of known node types and module identifiers
  • Canonicalize candidate paths and verify that they remain within an intended, restricted directory
  • Reject traversal indicators, absolute paths, unexpected separators, and other invalid path forms before resolution
  • Prefer registry-based module lookup over dynamic filesystem-derived imports
  • Apply least-privilege permissions to the n8n process and limit access to sensitive files
  • Reduce the privileges and filesystem visibility available to authenticated users

How teams detect issues like this

Detection approaches can include:

  • Static analysis rules for filesystem paths or dynamic imports constructed from request, workflow, or node-type data
  • Code review checks for missing path canonicalization, directory-boundary validation, or allowlisting
  • Runtime monitoring for unexpected module loads and access to files outside approved schema directories
  • Policy enforcement that restricts dynamic module loading to approved packages and locations
  • Automated security review tools that flag user-controlled values passed to path resolution or import APIs

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-6h4x-896x-fw5m
vulncheck.comvulncheck.com/advisories/n8n-before-remote-code-execution-via-path-traversal

Frequently asked

questions

It can be exploitable through n8n application functionality when an attacker can submit or influence the relevant node type. Exploitation still depends on authentication and the permissions granted to the account.

The described attack requires an authenticated user with global:member privileges. The practical scope also depends on which MCP and workflow features are enabled and accessible.

Replace filesystem paths derived from user-controlled values with an allowlisted registry of valid schema modules. Where path resolution remains necessary, canonicalize the path and enforce a strict directory boundary before loading it.

Treat node types and other configuration identifiers as untrusted input, use fixed mappings instead of dynamic imports, apply least privilege, and test path-handling logic with traversal and boundary cases.

Find out what's already
exploitable in your codebase.