Upgrade n8n to 2.42.6, 2.43.3 or 3.0.1
n8n: LangChain Code and Function nodes let workflow editors run code in the main process · Security incident · GitHub Advisory · n8n-io · Oct 28, 2026
What happened
n8n published a High (8.7) advisory on 28 Oct: the old Function and Function Item nodes run user code in the vm2 sandbox and the LangChain Code node runs it in the n8n main process, outside the task-runner isolation the Code node gets. Any logged-in user allowed to create or edit workflows could use them to run arbitrary code on the server. Versions 2.42.6, 2.43.3, 2.44.0 and 3.0.1 block these nodes by default; workflows already saved with them keep running, so admins need to replace them.
How to prevent it
Treat workflow-edit rights on an automation server as server access: keep that group tiny, patch quickly, and don't turn the new block off with N8N_DEPRECATED_NODES_BLOCK=false.
Fix prompt for your own AI tool
Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.
I self-host n8n for AI workflows. Help me fix GHSA-9p7v-45m2-wxgj: 1) Show me how to check my n8n version. 2) Give me the upgrade steps for my setup (Docker or npm) to 2.42.6, 2.43.3, 3.0.1 or later. 3) List every workflow that uses the Function, Function Item or LangChain Code nodes and help me rewrite each one with the Code node. 4) Review who can create or edit workflows and cut that list to people I fully trust.
Why this keeps happening: trusting agents & ai input
An AI agent treats everything it reads as possible instructions: a web page, a README, an email, a code comment or the output of another tool. If that content was written by an attacker, the agent can be steered into running commands, reading files or sending data somewhere it should not.
A quick checklist before you ship
- Give each agent only the tools and folders it needs for the task at hand.
- Require manual approval before it runs shell commands, sends network requests, deletes files or spends money.
- Do not open untrusted repositories or MCP configs with auto-run turned on.
- Keep API keys and production credentials out of any environment an agent can read.
More on this: every trusting agents & ai input story and our related guide.
Tools involved
Related stories
- If you run Hermes Agent with Bot Desktop inside a docker or ssh terminal backend, upgrade to 0.23.2 or later
Hermes Agent: code inside its Docker or SSH backend could set env vars on the agent's own machine, fixed in 0.23.2 - If you give an AI agent mcp-server-git, upgrade it to 2026.11.18 or later today, and don't point it at repos you haven't checked
mcp-server-git: six more ways a repo's own Git config could run commands, fixed in 2026.11.18 - Give AI assistant connectors their own scoped, short-lived tokens, never full session tokens
Mittwald's MCP server leaked customer session tokens, and an attacker used them to get into 56 hosting projects
Source: original post on GitHub Advisory ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.