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

More on this: every trusting agents & ai input story and our related guide.

Tools involved

n8n stories

Related stories

Source: original post on GitHub Advisory ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.

The Honest Build. Real stories, not hype.

Every week: real stories of what building with AI actually took, the one lesson worth keeping, and the security slip-ups to avoid. Free, unsubscribe anytime. Weekly, every Friday.