---
id: "GHSA-9p7v-45m2-wxgj"
page: "https://infrastack.ai/live/GHSA-9p7v-45m2-wxgj"
kind: "vulnerability"
aliases: ["GHSA-9p7v-45m2-wxgj"]
title: "Deprecated Code Nodes Allow Code Execution in the n8n Main Process"
severity: "high"
cvss: 8.7
epss: null
exploited: false
status: "open"
category: "ai-tooling"
products: [{"name": "n8n", "fixed": [">= 2.43.3"], "affected": "< 2.43.3", "ecosystem": "npm"}, {"name": "n8n", "fixed": [">= 2.42.6"], "affected": "< 2.42.6", "ecosystem": "npm"}, {"name": "n8n", "fixed": [">= 3.0.1"], "affected": "< 3.0.1", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["ai-tooling", "n8n", "self-hosted", "workflow-automation"]
not_affected_if: ["managed-hosting", "workflow-editing-restricted-to-trusted-users"]
published_at: "2026-10-28T08:47:05+00:00"
first_seen_at: "2026-11-09T22:53:26+00:00"
updated_at: "2026-11-09T22:54:10+00:00"
sources: [{"source": "ghsa-repo", "url": "https://github.com/n8n-io/n8n/security/advisories/GHSA-9p7v-45m2-wxgj", "first_seen_at": "2026-11-09T22:53:26+00:00"}]
exploit_sources: []
---

# Deprecated Code Nodes Allow Code Execution in the n8n Main Process

Link for people: https://infrastack.ai/live/GHSA-9p7v-45m2-wxgj (this .md is for agents)

The Function, Function Item and LangChain Code nodes in n8n run user code inside the main n8n process, outside the sandbox used for the regular Code node. An authenticated user who can create or edit workflows can use them to execute arbitrary code on the n8n server.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:n8n affected < 2.43.3 fixed >= 2.43.3
- npm:n8n affected < 2.42.6 fixed >= 2.42.6
- npm:n8n affected < 3.0.1 fixed >= 3.0.1

## How to check

- Check the n8n version with `n8n --version` or the `n8n` entry in `package.json`.
- Search existing workflows for the Function, Function Item and LangChain Code nodes and review who can create or edit workflows.
- Check whether `N8N_DEPRECATED_NODES_BLOCK` is set to `false`, which re-enables the vulnerable behavior.

## Fix

- n8n `2.42.6` for the 2.42 line
- n8n `2.43.3` for the 2.43 line
- n8n `3.0.1` for the 3.x line
- n8n `2.44.0` also includes the fix, per the advisory text

## Timeline

- 2026-11-09T22:53:26+00:00 ghsa-repo https://github.com/n8n-io/n8n/security/advisories/GHSA-9p7v-45m2-wxgj

## Documents

- [advisory] Vendor advisory: github.com https://github.com/n8n-io/n8n/security/advisories/GHSA-9p7v-45m2-wxgj

## From the sources

## Impact

The Function and Function Item nodes run user code in the vm2 sandbox, and the LangChain Code node runs user code in the n8n main process. An authenticated user with permission to create or modify workflows could use these nodes to execute arbitrary code in the n8n main process, outside the task runner isolation that applies to the Code node.

## Patches

In n8n versions 2.42.6, 2.43.3, 2.44.0 and 3.0.1, the Function, Function Item, and LangChain Code nodes are deprecated and blocked by default. Saving a workflow that adds or modifies one of these nodes is rejected; workflows already saved with these nodes continue to run unchanged. Administrators should review existing workflows and replace these nodes with the Code node.

The block can be disabled with `N8N_DEPRECATED_NODES_BLOCK=false`, which restores the vulnerable behavior.

Users should upgrade to one of these versions or later to remediate the vulnerability.

## Workarounds

If upgrading is not immediately possible, administrators should consider the following temporary mitigations:
- Add `n8n-nodes-base.function`, `n8n-nodes-base.functionItem`, and `@n8n/n8n-nodes-langchain.code` to the `NODES_EXCLUDE` environment variable to prevent these nodes from being used.
- Limit workflow creation and editing permissions to fully trusted users only.

These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
