n8n Python Code Node AST Bypass Vulnerability
A security vulnerability in n8n allows authenticated users with permission to create or modify workflows containing a Python Code node to bypass the AST security validator and access the task executor module namespace.
What changed
A security vulnerability in n8n allows authenticated users with permission to create or modify workflows containing a Python Code node to bypass the AST security validator and access the task executor module namespace. On self-hosted instances with N8N_BLOCK_RUNNER_ENV_ACCESS=false, this extends to disclosure of environment variables.
Who it affects
Instances where the Python Task Runner is enabled and N8N_BLOCK_RUNNER_ENV_ACCESS=true.
What to do today
Upgrade to n8n versions 2.25.7 or 2.26.2. If upgrading is not immediately possible, limit workflow creation and editing permissions to trusted users, disable the Python Code node via NODES_EXCLUDE, or disable the Python Task Runner entirely.