Headline
GHSA-62r4-hw23-cc8v: n8n Vulnerable to Arbitrary Command Execution in Pyodide based Python Code Node
Impact
A sandbox bypass vulnerability exists in the Python Code Node that uses Pyodide.
An authenticated user with permission to create or modify workflows can exploit this vulnerability to execute arbitrary commands on the host system running n8n, using the same privileges as the n8n process.
Patches
In n8n version 1.111.0, a task-runner-based native Python implementation was introduced as an optional feature, providing a more secure isolation model.
To enable it, you need to configure the N8N_RUNNERS_ENABLED and N8N_NATIVE_PYTHON_RUNNER environment variables.
This implementation became the default starting with n8n version 2.0.0.
Workarounds
- Disable the Code Node by setting the environment variable
NODES_EXCLUDE: "[\"n8n-nodes-base.code\"]"(Docs) - Disable Python support in the Code node by setting the environment variable
N8N_PYTHON_ENABLED=false, which was introduced in n8n version 1.104.0. - Configure n8n to use the task runner based Python sandbox via the
N8N_RUNNERS_ENABLEDandN8N_NATIVE_PYTHON_RUNNERenvironment variables. (Docs)
Resources
- n8n documentation: Blocking access to nodes
- n8n documentation: Code Node (Python)
- n8n documentation: Task Runners
Impact
A sandbox bypass vulnerability exists in the Python Code Node that uses Pyodide.
An authenticated user with permission to create or modify workflows can exploit this vulnerability to execute arbitrary commands on the host system running n8n, using the same privileges as the n8n process.
Patches
In n8n version 1.111.0, a task-runner-based native Python implementation was introduced as an optional feature, providing a more secure isolation model.
To enable it, you need to configure the N8N_RUNNERS_ENABLED and N8N_NATIVE_PYTHON_RUNNER environment variables.
This implementation became the default starting with n8n version 2.0.0.
Workarounds
- Disable the Code Node by setting the environment variable NODES_EXCLUDE: "[“n8n-nodes-base.code”]" (Docs)
- Disable Python support in the Code node by setting the environment variable N8N_PYTHON_ENABLED=false, which was introduced in n8n version 1.104.0.
- Configure n8n to use the task runner based Python sandbox via the N8N_RUNNERS_ENABLED and N8N_NATIVE_PYTHON_RUNNER environment variables. (Docs)
Resources
- n8n documentation: Blocking access to nodes
- n8n documentation: Code Node (Python)
- n8n documentation: Task Runners
References
- GHSA-62r4-hw23-cc8v