/

CVE-2025-71380

Severity:

HIGH RISK

(8.8)

Command Execution Abuse (CWE-284) via n8n Node

CVE-2025-71380

Deferred

Vulnerability type

Category:

Improper Access Control

CWE:

CWE-284

Impact:

Arbitrary Command Execution by Authenticated Users

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

The Execute Command node in n8n allows authenticated users to run arbitrary commands on the host system where n8n operates.

When users or compromised accounts can freely configure this node, it can be misused for data exfiltration, service disruption, or full system compromise.

Affected context

This vulnerability appears in n8n workflows that use the Execute Command node without sufficient access restrictions or guardrails.

It becomes risky when standard or low-privileged users can create or modify workflows that run on the main n8n instance host, especially in shared or multi-tenant environments.

The risk grows when n8n is deployed with broad OS-level privileges or network reach, enabling access to sensitive data or infrastructure from workflow-executed commands.

Exploit preconditions

  • Attack surface: n8n workflow editor and execution environment
  • Required access: Valid n8n user account or compromised credentials with permission to create or modify workflows using the Execute Command node
  • Trigger point: Running a workflow that contains the Execute Command node configured with attacker-controlled command input
  • Why exploitation is possible: The node provides a generic bridge from workflow logic to the host operating system without strong role-based or contextual restrictions on who may issue arbitrary commands

Why this happens

The underlying issue is an access control design flaw where a powerful capability—executing host-level commands—is exposed directly to general workflow authors.

This maps to CWE-284: Improper Access Control, as the platform does not adequately differentiate between routine automation permissions and high-risk, system-level operations.

In abstract terms, the product grants users the ability to send unbounded commands to an external execution environment (the OS) without enforcing strict authorization tiers, usage constraints, or isolation for that capability.

Potential impact

  • Authenticated users may execute arbitrary commands on the n8n host system
  • Attackers could exfiltrate sensitive files, environment variables, or database contents
  • Workflows can be used to disrupt services, delete data, or alter configurations
  • Command execution can enable lateral movement to adjacent systems or networks
  • Full compromise of the host running n8n may occur, depending on existing OS privileges

General mitigation guidance

Effective mitigation centers on reducing which identities can access host-level command execution and isolating that capability from general workflow use.

Common defensive patterns include:

  • Applying strict role-based access control so only highly trusted operators can configure or invoke command execution nodes
  • Segregating sensitive execution capabilities into dedicated, locked-down environments separate from routine workflow authors
  • Limiting the commands or binaries that may be run, favoring whitelisted, well-scoped operations
  • Running n8n with least-privilege OS accounts and minimizing access to critical data and infrastructure from the workflow host
  • Using network and filesystem isolation to constrain what executed commands can reach or modify

How teams detect issues like this

Organizations can detect risky usage by:

  • Reviewing workflow definitions for nodes that trigger host-level command execution or shell access
  • Implementing policy checks in CI/CD or change management that flag addition or modification of high-privilege nodes
  • Using static or configuration analysis to spot patterns where user-controlled inputs are passed directly to command execution nodes
  • Monitoring runtime logs for unusual or high-risk command invocation from workflows, correlating with user identities and change events
  • Periodically auditing role and permission assignments to ensure only intended users can use powerful execution primitives

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-365g-vjw2-grx8
vulncheck.comvulncheck.com/advisories/n8n-arbitrary-command-execution-via-execute-command-node

Frequently asked

questions

Not directly. Exploitation requires an authenticated n8n account or stolen credentials that can create or modify workflows using the Execute Command node.

An attacker needs a user account with sufficient permissions to design or edit workflows containing the Execute Command node, or access to an existing workflow where the node is already present and executable.

The safest pattern is to severely restrict or disable host-level command execution capabilities for regular users, enforce strong role-based controls, and isolate any necessary command execution to tightly controlled environments with minimal privileges.

Future designs should treat system-level execution features as highly privileged operations, wrap them in strong authorization checks, impose clear usage boundaries, and ensure deployment architectures limit the blast radius of any misuse through isolation and least-privilege principles.

Find out what's already
exploitable in your codebase.