mediumAgent ThreatFramework Vulnerability

n8n JS Task Runner Cross-Tenant Module-Cache Poisoning

First seen Jul 23, 2026 · Updated Jul 23, 2026

n8nworkflow-automationcode-nodemodule-cachecross-tenantisolation-breakjs-task-runnerASI04 · Agentic Supply ChainSurface: Tool LayerPropagation: Single Hop

n8n's JavaScript task runner shared a single module cache across all users' Code-node executions on the same instance, allowing one user to poison a cached module and affect other users' automations. This is a multi-tenant isolation failure rather than a sandbox escape or remote code execution, but it can compromise confidentiality, integrity, or availability of other tenants' workflow logic.

Technical Analysis

The entry point is the n8n Code node, which lets users execute arbitrary JavaScript within workflows via a shared JS task runner process. Because the runner cached required modules (built-in or external) globally rather than per-user or per-execution, a malicious or compromised user could overwrite or tamper with a cached module object, and that poisoned module would then be reused in subsequent, unrelated executions from other tenants sharing the same runner. This crosses the tenant/user trust boundary within a single n8n instance: an attacker with legitimate low-privilege Code-node access gains the ability to influence code execution behavior of other users' workflows without needing to escape the JS sandbox itself. Impact scope depends on what the poisoned module does downstream (e.g., altering data, exfiltrating credentials passed through workflows, or crashing other users' executions).

Affected Systems

n8n

Detection Signatures

  • Review Code node executions for unexpected mutation of shared/global module objects (e.g., monkey-patching require()'d modules' prototypes or exported functions)
  • Audit logs for anomalous behavior changes in Code node outputs uncorrelated with workflow edits
  • Monitor for use of NODE_FUNCTION_ALLOW_BUILTIN / NODE_FUNCTION_ALLOW_EXTERNAL enabling broad module access on multi-tenant instances
  • Look for JS task runner crash/error spikes coinciding with new or edited Code nodes from a single tenant
  • Inspect for repeated re-definition of standard library methods (e.g., Array.prototype, JSON.parse) within workflow code

Remediation Steps

  1. 1

    Upgrade n8n

    Update to n8n 1.123.67, 2.31.5, 2.32.1, or later where the module cache isolation fix is applied.

  2. 2

    Restrict multi-tenant access

    Until patched, limit n8n instance access to fully trusted users only, avoiding untrusted multi-tenant sharing of a single JS task runner.

  3. 3

    Disable module access in Code nodes

    Unset NODE_FUNCTION_ALLOW_BUILTIN and NODE_FUNCTION_ALLOW_EXTERNAL to remove the poisonable module surface as a temporary mitigation.

  4. 4

    Use per-user/project external runners

    If supported, deploy external runner mode with a dedicated runner per user or project to enforce execution isolation.

  5. 5

    Audit workflow code history

    Review Code node workflow history for suspicious module manipulation patterns predating the upgrade.

CVE / Advisory IDs

GHSA-9cmh-xcqm-5hqr

Industries Most Exposed

Software/SaaSIT/DevOps automationManaged service providersAny organization using multi-tenant n8n deployments

Sources

Respond to this threat

Pro subscribers get a full AI-generated incident-response playbook for this threat — detection, containment, eradication, and recovery steps — plus an unlimited AI Threat Advisor for questions about your environment.