/

CVE-2026-49444

Severity:

HIGH RISK

(8.5)

Input Validation Flaw (CWE-20) in n8n Python Node

CVE-2026-49444

Analyzed

Vulnerability type

Category:

Input Validation / Sandbox Escape

CWE:

CWE-20

Impact:

Arbitrary Code Execution in Task Runner Container

Severity:

HIGH RISK

(8.5)

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

An input validation flaw in n8n's Python Code Node allows authenticated workflow designers to escape the intended sandbox and run arbitrary code on the task runner container.

When a user can create or modify workflows containing Python code, insufficient validation and isolation controls can turn business automation workloads into an application-level remote code execution vector.

Affected context

This vulnerability appears in n8n installations that expose the Python Code Node to authenticated users who can create or modify workflows.

It is relevant where task runners execute user-supplied Python code under the assumption of sandboxed isolation, but the enforcement of that isolation and validation of untrusted code is incomplete or flawed.

The risk is higher in multi-tenant or shared environments where workflow authorship is delegated to non-admin users and task runner containers have access to sensitive systems or data.

Exploit preconditions

  • Attack surface: n8n workflow editor and execution engine, via the Python Code Node.
  • Required access: Authenticated access with permissions to create or modify workflows that include Python code.
  • Trigger point: Execution of a workflow containing crafted Python Code Node content on the task runner.
  • Why exploitation is possible: The sandbox and validation layer around user-provided Python code is insufficiently strict, allowing code patterns that bypass isolation controls and execute with the container's runtime privileges.

Why this happens

The underlying issue maps to CWE-20 (Improper Input Validation), where the system assumes that user-supplied Python code, once placed in a "sandboxed" node, will be safely constrained.

In practice, the sandbox and validation mechanisms do not adequately restrict available APIs, execution context, or escape vectors, letting crafted code interact with the broader runtime.

The insecure pattern is treating user-authored automation logic as trusted, without enforcing robust isolation boundaries or strong validation of what that code can do inside the execution environment.

Potential impact

  • Authenticated users may execute arbitrary OS-level commands in the task runner container.
  • Attackers could access secrets, environment variables, or credentials available in the runner.
  • Workflows can be abused to pivot into connected services, data stores, or internal APIs.
  • Malicious automation may modify or exfiltrate workflow data, logs, or configuration.
  • In some deployments, compromise of the task runner could facilitate further lateral movement.

General mitigation guidance

Mitigation generally focuses on reinforcing the boundary between user-supplied workflow code and the underlying execution environment.

Common patterns include:

  • Restricting or disabling generic code-execution nodes (such as Python Code Nodes) in multi-tenant or untrusted user contexts.
  • Applying strict input validation and policy controls to workflow code, limiting available libraries, system calls, and I/O.
  • Running task runners with minimal OS-level privileges and isolating them from sensitive networks, secrets, and file systems.
  • Introducing defense-in-depth sandboxing (containers, seccomp, AppArmor, or language-level restrictions) around user-provided code.
  • Establishing clear trust boundaries so that only highly trusted operators can define or modify nodes that execute arbitrary code.

How teams detect issues like this

Effective detection blends configuration review, workflow inspection, and code-level analysis:

  • Use static analysis or linting on workflow definitions to flag Python Code Nodes or patterns that access system-level resources.
  • Implement review workflows where changes to code-execution nodes require approval from security or platform engineers.
  • Monitor task runner containers for anomalous process creation, filesystem access, or outbound network connections.
  • Apply policy-based controls (e.g., admission checks) that prevent deployment of workflows using disallowed node types or constructs.
  • Consider automated security tooling that can scan workflow repositories and configuration for unsafe code-execution capabilities.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-9pq8-m8gp-4p53

Frequently asked

questions

No. Exploitation requires authenticated access with permissions to create or modify workflows containing a Python Code Node, though in some organizations these permissions may be widely granted.

The attacker's code runs inside the task runner container with the privileges assigned to that runtime, which may include access to environment variables, attached volumes, and network resources reachable from the container.

Limit who can define or change Python Code Nodes, harden sandboxing around user-supplied code, and ensure the runner operates with least privilege and clear separation from sensitive systems.

Treat user-authored automation code as untrusted, enforce strict input validation and execution policies, incorporate security reviews into workflow changes, and adopt layered isolation techniques for any feature that runs user-provided code.

Find out what's already
exploitable in your codebase.