Skip to main content

n8n: CVE-2026-119408

Escape the n8n vm2 sandbox through a deprecated code node, steal the encryption key, then patch.

Task 1: Introduction: When Automation Escapes the Sandbox

Priya Raman is head of the Automation team at Copperline Energy (a regional energy operator). Their self-hosted n8n instance is the operational plumbing, in that it's what handles the meter data syncs, the enrichment of outage tickets, the scheduled reporting, etc. The estate is on an older n8n release behind very slow change control, so security releases are effectively on hold. She's had to commission an internal self-audit because no one knows what that pin actually costs.

CVE-2026-119408 is n8n's October 2026 entry in the Common Vulnerabilities and Exposures (CVE) catalog, the public registry where disclosed flaws receive stable identifiers. It is mirrored in the Open Source Vulnerabilities (OSV) record. n8n deprecated certain workflow nodes, marking them as replaced and slated for removal. Those same nodes kept executing user JavaScript in the n8n main process, outside the isolated task runner that ordinary workflow code runs in. GitHub's advisory GHSA-9p7v-45m2-wxgj, titled Deprecated Code Nodes Allow Code Execution in the n8n Main Process, records the defect.

The CVE Numbering Authority record at VulnCheck carries the score: the Common Vulnerability Scoring System (CVSS), version 4.0, grades the flaw 8.7 out of ten, High. It also assigns the weakness to CWE-653 (Improper Isolation or Compartmentalization), which names the missing isolation exactly. The score is a number for the question Priya's audit is asking. The same record compresses all of that into one vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N. The letters read as noise now; they won't once the lab has shown you what each input describes.

The lab is, in effect, Priya's estate. One target VM has all three services.

Service Hostname Port
Production n8n, the vulnerable target automation.copperline.thm 5678
Staging n8n, the patched control automation-staging.copperline.thm 5679
Team snippet store automation-files.copperline.thm 8080

Production is still on 2.42.5. Staging is running 2.42.6 (the first patched release on that line). The snippet store serves up the team's exported workflow files via plain HTTP. The three names all point to the same address (MACHINE_IP), which TryHackMe assigns when the machine starts. They're all wired together via a single /etc/hosts entry, which is added once the machine is up.

You have a member seat on default settings, import one of the team's own workflow snippets and watch the code run from a node that shouldn't even be there. The same workflow then ends up on the patched staging twin and is refused at save time there. The audit from that point on is defensive, and you'll work out how that exposure is detected and closed.

The sandbox escape follows 0x4bd0's published write-up and the HTTP request flow follows the lab Abraxas Labs released alongside their disclosure, both credited where the room uses them.

Learning Objectives

This room covers one n8n vulnerability from record to working escape to verified patch. You'll in particular learn how to:

  • Explain the deprecated-node isolation gap and its CVE record.
  • Establish a workflow-creating foothold on default settings.
  • Import and run a workflow that names a hidden node type
  • Trace the sandbox escape to the real environment.
  • Recover environment secrets through the credited escape.
  • Drive the identical workflow at the patched control.
  • Plan detection and mitigation for the exposure

Room Prerequisites

You should be comfortable driving a web app from the browser and reading a request in the dev tools network tab. Basic Linux shell work and curl against an HTTP API completes the picture. No n8n experience is required, as the room teaches you every n8n concept it uses as it comes up. If you're new to the series, then the earlier rooms in the Recent Threats module cover similar ground and would make a good warm-up, though again you don't need them for this room.

Before you start Task 2, press the Start AttackBox button to start the Attacker machine and press the Start Machine button to start the Target machine so that they are ready when you need them in later tasks.

Task 2: Deprecated Code Nodes

Take an item off a menu, and the kitchen can still cook it. The order form names the dish rather than the shelf it sits on. In late September 2026, Abraxas Labs published evidence that n8n made the same trade with three of its workflow nodes. The product marked them as replaced, hid them from the node palette, and kept resolving them anyway. A saved workflow names node types by string rather than by menu position, and the palette is only the editor's catalog of what you can drop onto a canvas. Where that reachability leads is the part worth your attention. The hidden nodes execute user JavaScript inside the n8n main process, the one process hosting everything else the instance does.

You met the record in this room's opening: CVE-2026-119408, graded 8.7 under the Common Vulnerability Scoring System (CVSS). The same record carries weakness class CWE-653 and the full vector printed once. You met Copperline Energy's premise there too: production pinned to release 2.42.5 while staging holds the patched 2.42.6. This task asks what deprecated actually enforced. The answer decides whether Priya's pinned estate holds a hygiene gap or a foothold waiting for a member login.

Replaced on Paper

n8n deprecated this family without removing it:

  • Function node (n8n-nodes-base.function), the long-standing free-form JavaScript step
  • Function Item node (n8n-nodes-base.functionItem), its per-item sibling
  • LangChain Code node (@n8n/n8n-nodes-langchain.code), the node for AI-chain code, counted among the deprecated code nodes by advisory GHSA-9p7v-45m2-wxgj

The n8n documentation for the Function node states the replacement in one line: the Code node replaced the Function and Function Item nodes. The replacement landed in release 0.198.0, which the npm registry's publish record dates to 2022-10-14. The Code node executes user JavaScript too, just from a different place, and that difference is the vulnerability.

Deprecation did very little indeed. It simply removed the retired definitions from the node palette. Everything else remained as it was. The definitions stayed installed, still registered and still executable. Just not visible.

Where the Legacy Code Actually Runs

Location claims require evidence, and the disclosure provides it. Abraxas Labs ran a very short identifying script in each node class on a stock n8n 2.42.0 build, asking the running process to identify itself. An OS assigns every running process a process ID, and the n8n main process is no different. The script in the hidden Function node reported a process ID matching the main process. Inside the modern Code node, the same JavaScript couldn't identify a process at all and reported hasProcess: false. The task runner that is executing the code is the process at pid 26:

main_pid=7
runner_pid=26
function_pid=7

A process ID match means the same process. The hidden node's code ran where the whole product runs: the main process holds the instance's database connections, credential store, and settings. The Code node's execution landed elsewhere by design, in the isolated task runner n8n delegates user code to over a websocket link. External deployments run it as its own container. Internal mode runs it as a child process that n8n's task-runner documentation labels "insecure by design" and deprecates from 3.0.

Every hardening guard sits on that runner lane. From release 2.0, shipped in December 2025, task runners turn on by default, so ordinary Code node executions run isolated. Environment reads from Code node code are now blocked by default, through N8N_BLOCK_ENV_ACCESS_IN_NODE, as n8n's v2.0 breaking-changes notes record. The runner child also starts with --disallow-code-generation-from-strings and --disable-proto=delete, restrictions on dynamic code generation and prototype tampering. None of it reaches the legacy trio. Its lane was never the runner. Its code executes in the main process, wrapped in vm2, a Node.js sandbox library that runs untrusted JavaScript in a restricted context. CWE-653 names that gap: critical pieces operating without the compartmentalization the design promises.

Hidden Is Not an Access Control

Execution location only matters when a hidden node actually ends up on a canvas, and the palette will never provide one. An n8n workflow is stored as workflow JSON (JavaScript Object Notation), a JSON document containing the nodes, connections, and settings. Each node type within it is a string. When n8n loads a workflow (whether it's saved or imported), it resolves those strings against the registered node definitions (hidden property included). Name it n8n-nodes-base.function in JSON, and the type will resolve and run as it did previously. Abraxas Labs put the finding plainly: "Palette hidden is not an ACL." An access control list (ACL) would check who is asking before refusing anything. The hidden property does none of that. It simply decides what the palette will draw.

The deprecation arrived on 2022-10-14. The backend that enforces it does so by refusing to save or import a workflow that adds one of the three types. The gate did not exist until pull request #31360 merged on 2026-10-08, as part of the fix the CVE record tracks. Between those two dates, the only thing separating a member from the main process was a palette flag. Copperline's pin sits inside that span, which is why production still accepts the retired types today.

A Sandbox With a History

vm2 needs its own timeline. Its maintainers discontinued their own project. The letter published alongside issue #533 on 2023-07-12 calls the situation an escape "so complicated that fixing it seems impossible" and announces "the discontinuation of this project." The same issue was closed as completed on 2025-10-24 with a revival announcement and a v3.10.0 release the same day. The npm registry's record for vm2 lists 3.12.2 as the current release, published 2026-09-08. The project's current README carries an Important Security Disclaimer: "New bypasses will likely be discovered in the future." and "vm2 should not be your only line of defense." The sandbox under Copperline's legacy lane is vm2, discontinued once and revived since. Its README today warns that it must not stand alone.

Who Can Reach It

Task 1 printed the vector once, and one field states the account level an attacker must hold for the attack to apply. The advisory's prerequisite sentence matches Copperline's everyday logins precisely: "an authenticated user with permission to create or modify workflows." A member seat on default instance settings carries that permission on a fresh install, as n8n's instance-roles documentation describes. No misconfigured admin group is needed to put the estate in scope. The member seat the lab issues you is the record's own threat model, not a lab convenience.

Try It Yourself: Task 1's printed vector packs the attack's preconditions into lettered fields, and this task has only read one of them. Walk the string and find the field which tells you whether the attack requires a real person to click, approve, or open anything as part of the journey. Then read the value that follows that field's colon. Knowing that verdict before you go end to end with the attack is worth the minute.

You can now describe the flaw in terms of its anatomy: three node types are marked as replaced and hidden, all of which execute their user code in the main process within a sandbox that has a well-documented history. What you can't do yet is reach one. The palette offers nothing. Copperline's own starter snippet already has one of the hidden type strings in its JSON, and a member seat is sufficient to open the editor that would import it.

Answer the questions below

  1. Task 1 printed the CVE record's CVSS v4.0 vector. Which component of that vector states the privilege level an attacker needs? (Answer Format: the component and its value)

  2. The Code node replaced the Function and Function Item nodes when version 0.198.0 shipped on 2022-10-14, yet the backend gate for the hidden types only merged on 2026-10-08. Roughly how many years stayed open between those two dates? (Answer Format: a whole number)

Task 3: Into the Automation Team

Every write-up of this flaw opens its prerequisite list at the same unremarkable item: one authenticated account with rights to create workflows, on an instance whose settings nobody hardened. The Abraxas Labs' disclosure proved on a stock build that this alone is the whole prerequisite. The pair is an ordinary member seat on default instance settings, with no admin role anywhere in the chain. A member seat is the user role the platform hands out for free. Default instance settings are the ones a fresh install boots with. Copperline issues that pair, and that is where you now sit. So the next few minutes are the attacker's own problem: prove what this ordinary seat can legitimately reach before you ask it for anything exceptional.

On the Instance by Name

For the attacker, the estate is names, and for this lab it is one address. The hosts file is your machine's private address book. Before it queries a DNS server to find a name, it checks the hosts file. You don't have a DNS server for those names, so you just write the page yourself.

echo "MACHINE_IP automation.copperline.thm automation-staging.copperline.thm automation-files.copperline.thm" | sudo tee -a /etc/hosts

One line ties all three lab names to the same VM (the editor's production instance, the staging twin, and the team's snippet store). The editor's port is the one you want. Open http://automation.copperline.thm:5678 in the AttackBox browser, and you'll see the login page.

The Seat and the Network Tab

Sign in with member@n8nlab.thm and the password Copperline2026. Before you submit, open the browser's developer tools and stay in the Network tab. The editor is a single-page application (SPA): one page of JavaScript rendering the whole interface. Every button that appears local is actually a request, which is why the request layer lets a member drive the whole instance. The editor and its API share one port, and every call the editor makes passes through one shared prefix.

Submit the form and find the POST that carries your login details. The response is JSON. Read the body, not the status code. The SPA shell will return an HTTP 200 for any path it doesn't route, so a 200 in response to a wrong path tells you absolutely nothing. An editor route will return JSON; the fallback will return HTML.

What the Palette Does Not Show

Now open the panel that lets you add a node to the canvas and search it as a very curious member would. Type in the old Function family name, then the item-level sibling, then the LangChain sibling. Nothing comes up from any of those. Only the modern Code node gives you anything.

That result doesn't contradict Task 2's verdict. Hidden was never behind an access control list (ACL). The flag simply determines what the palette draws. A workflow JSON that names one by string still resolves on the backend. All the search has proven is which half of the story the palette has.

The Reach the Seat Owns

Build the dullest workflow the editor will allow: a Manual Trigger node feeding into the standard Code node with a single line of vanilla JavaScript.

return [{ json: { status: "baseline-ok" } }];

Run it and watch it execute successfully. Nothing here is the vulnerability; this is the baseline against which you measure the contrast. The seat's normal reach is to create and run, all via defaults with no gate of any kind in the way.

Try It Yourself: keep the Network tab open and reload the editor's page. Filter the tab to Fetch/XHR, so the static asset loads disappear, and you're left with the editor's own calls. Confirm those calls share the prefix as the login POST. Then type in a path of your own making under that prefix in the address bar. Compare the answer with a genuine editor call's, content type included. Hold on to what gave the fake one away: the status code and the body disagree about what exists on this server.

A foothold is built in stages, and the relevant stage here is measurement. You can't reason about an exceptional call until you know what an ordinary call gets for free. The surface you saw in the network tab is the same surface that a command-line client can then replay later, request by request. It's that replayable surface which is the observation you want to keep.

Two facts for you. A working member session is still running on automation.copperline.thm in your browser. You can see a request showing the editor talking to its backend. The forbidden node family is not in the palette and is reachable by name from workflow JSON. Priya's team has their starter snippet sitting on the third hostname you pinned. Your session is what imports it, and the same request flow is what drives it elsewhere.

Answer the questions below

  1. Open your browser's developer tools while you log in to the Automation instance and watch the network tab. What path does the editor POST your login to? (Answer Format: a path beginning with a slash)

Task 4: Saving the Forbidden Node

Your member session is still active in the AttackBox browser, and the team's starter snippet is still waiting on the third hostname you pinned. You've already established what the palette is: a catalog that hides the forbidden nodes and checks nothing else. The snippet's own JSON can in fact name a type that the palette will never provide. What happens when Copperline's very own starter snippet puts the forbidden node on your canvas?

The Snippet on the Third Hostname

Bring the file down before you touch the editor:

curl -s -o automation-starter.json http://automation-files.copperline.thm:8080/automation-starter.json

The file lands in your working directory as the original, untouched file. Take a fresh copy for each experiment, as every deliberate break starts from that file.

Open the vulnerable editor at http://automation.copperline.thm:5678. Start with the fresh New workflow canvas. Bring the file in via the editor's workflow import control and then save. The import adds the file's nodes to the currently open canvas and renames the workflow to the file's name. Saving a new canvas will create the record on this instance. Once the canvas has settled, the node the palette will not give you is already on it. A string in the team's own file is used to place that node there.

As the import is additive rather than replacement, each experiment below commences on a brand new New Workflow canvas with its own edited copy of the original. No canvas ever has the nodes from a previous experiment.

The import brings the file's nodes but leaves the file's wire behind. This canvas has none. The baseline never did: you drew the wire in by hand. A workflow with nothing connected to its trigger will just run the trigger. Give the node its own run: select it and press Execute step (the single node run control on the node card). The run's entry appears in the editor's logs panel. Open that up, and the node's output panel responds with an object containing a status token and a fresh timestamp. Don't go down the command line read route here, as it just outputs n8n's internal storage format, which looks like index soup.

Nothing at import, nothing at save, nothing at run. The silence is the finding. The backend save gate came in with the fix, and this pinned release predates that. An ordinary member seat took us right through the whole path.

Where This Node Prefers Its Code

Select the Heartbeat node and open its JSON. The editor's node view and the file contain the same document. You know where the standard Code node gets its code from the baseline (it's all in one flat field, pulled straight from that). This node has no such field.

The difference is filing. The last task's node had its code simply taped to the front of the cabinet. This node files the same page in a folder inside the cabinet. Only a reader who goes through the folders will see it. Where the ordinary Code node will answer one field name, this node's executable code only resolves at the end of a route of objects.

Walk down through the node's parameters in the JSON until you get to the JavaScript string. That path from the parameters object down to the code is the actual address that the node reads. Adjacent to the nested code in the parameters, you'll find one other thing: an Outputs parameter, which is the output declaration for the node. That's the dock paperwork. The dock is built for the parcel size that the paperwork declares, and an undeclared shape gets rejected. The runner reads that declaration prior to your code even speaking, and without it the expected shape will fall back on an assumption that your flat answer will not meet.

Break It and Read the Runner

An import that already ticks every box says nothing, so have the runner lay out its rules one objection at a time.

The Code's Home

The last task's ordinary Code node had its code in a single flat field (name included). Take a fresh copy of the original and pull the heartbeat's code string out of its nested location and into that flat field. Import the modified copy onto a fresh canvas, save and run. Import accepts, save accepts, run fails with an objection as to which execution step it found no code for. Nothing at all answers at that flat location on that node type. No beat requires a restore, since each one starts fresh.

The Declaration

Then the declaration. Take a fresh copy and delete the whole 'Outputs' parameter from the Heartbeat node's parameters. Import onto a fresh canvas, save and run. The save will still accept it. The runner will not. Its objection is now to the shape of the return. The message tells you precisely what it expected (in words) right where your flat answer was sitting. Read that description on your box and count the nesting it refers to.

Try It Yourself: take another fresh copy of the original. Delete the in-parameters declaration again, then put it back at the node level as an outputs key alongside the node's parameters object. Import onto its own fresh canvas, save and run. Compare what the save does versus what the runner does: the misplaced key saves without a word, and the runner's complaint is still there.

The pattern to follow in the loop is this: let the runner's objection name the missing structure before you do anything to it. The first objection was about a step with no code; the second was about a return shape and left the count to us. One pristine original and one break per import, and every objection was attributable. Two objections on a single run would have been a complete mystery.

Finish on the working version. Take a clean copy of the original untouched version, import it onto its own clean canvas, save, and run it again. The heartbeat comes back. Leave that record saved. That's the one saved last of all the same-named experiments and the one the next task will open. You can now place a node that the palette will refuse to name, import it, save it without a warning, and read its answer from a member seat. What that node's code can reach from where it runs is the very question this instance is set up to answer.

Answer the questions below

  1. Open the imported LangChain Code node's JSON in the editor. What dotted path, starting at the node's parameters object and ending in the JavaScript source the node runs, carries that code? (Answer Format: the full dotted path from the parameters object down to the code)

  2. Your flat, single-item return only runs because the snippet declares the node's main output. Remove that declaration and the runner expects a differently nested shape: how many list levels deep must the return be then? (Answer Format: a number)

Task 5: The vm2 Escape

The forbidden node is now on the production canvas, running team code under vm2 and answering as any other step would. The whole point of a sandbox is to provide a substitution; the code inside runs in a stand-in environment that copies the real one and is effectively walled off. So if the sandbox is substituting a fake environment for the sandboxed code, why does the getter for an allowlisted module still reach the real one?

Where the Sandbox Ends

vm2's protection has an exact edge. The sandbox boundary only covers code that's executing as part of the sandbox call. Anything running inside that call reads the stand-in environment vm2 hands it. process.env comes in as a fake that's been installed by the substitution. The boundary contains everything the script does inside that call.

Compiled before work keeps its origin. A closure is a function that carries the scope it was born in, and such a function will run in its original binding context wherever the call occurs. The substitution is available for code that vm2 compiles. It has no way of re-isolating a module that the outer runtime loaded earlier. Born outside, such a function answers outside.

A hotel card opens only one guest's floor, and its reach stops there. A staff badge issued long before check-in will open the back office when the bearer needs to run an errand. The stand-in environment is the guest's card and the pre-compiled module function is the staff badge.

None of this needs vm2 to fail, and that's what should reshape the trust verdict. The sandbox's own history is on your page already: maintainers who discontinued the project over an escape they judged unfixable, a revival since. The vm2 README still insists it must not stand alone. Caution is the right reading of that record. This escape rides on the sandbox's own invitation.

The Allowlisted Path

The LangChain Code node's sandbox is by no means a sealed room. It has a resolver allowlist for the packages that can be resolved in there, which is appropriate for the node's AI-agent work, where we're going to be loading in trusted libraries. The allowlist covers the langchain package and the entire @langchain/* prefix so @langchain/core is allowlisted by default. Within that sandbox, require("@langchain/core/utils/env") will just answer.

@langchain/core ships an environment getter named getEnvironmentVariable. It lives in the module's environment utilities and calls process.env directly. The line that does it: if (typeof process !== "undefined") return process.env?.[name]; 0x4bd0's write-up records the detail that matters next: the module "was loaded by the outer Node.js runtime before the sandbox started". Its pre-compiled getter still references the real one: the process.env of the main n8n server process.

What's odd about this escape is that no vm2 bypass was found or used, and no boundary was crossed. The require was on the allowlist and the getter's world was fixed at compile time. The write-up applies the same pair to a deployment's secret material. The room takes them to a lower value first so the proof is absolutely free.

Point the Getter at the Timezone

The vehicle is the working Heartbeat record the last task left saved, with your member session still open. Your session's Overview list will contain all of the saved records under one shared name (newest first), so the record that was saved last will be at the top. Open it.

The record opens on its canvas. A single click selects the Heartbeat node. A double-click will open its editor dialog. The dialog lays the node's parameters out as fields, and the code field holds the executable JavaScript where your JSON reading found it.

Select everything in that code field and replace it with this fence, which points the getter at one name (the container's timezone setting).

const { getEnvironmentVariable } = require("@langchain/core/utils/env");

const containerTz = getEnvironmentVariable("GENERIC_TIMEZONE");

return [{ json: { container_timezone: containerTz } }];

The getter answers by the name in its argument. A name the container answers returns its value. A name with nothing behind it returns as undefined, and the returned JSON drops that field from the output. The timezone is the one thing we're deliberately targeting, as it proves the route without revealing anything else of significance. The fence just echoes whatever the container returns, and the box supplies the value you get back. The Outputs parameter remains in the node's parameters as it was, and the single-item return still operates on it.

Save with Ctrl+S. The save updates the record you opened, and the list remains unchanged. With the dialog still open, press Execute step. The run appears in the logs panel below the canvas, with the node's entry already selected and its Output detail rendered immediately. In the table view, the output shows a single row, and the timezone value appears in that row. The Input pane in the still-open dialog shows the same item. Run for run, the node's own run figure is a beat longer than the heartbeat's. The probe is doing the actual resolving work, so that longer beat is the work.

Try It Yourself: the contract has a second half that's definitely worth a look at. Swap the quoted name in the fence for a made-up word no container variable answers, save, and press Execute step as before. Read the Output row and compare it to the timezone run. Restore the timezone's name afterward, save again, and leave the working probe in place.

A sandbox boundary is defined by where substitution kicks in, so the first question about sandboxed code is what names it's allowed to load and where those modules were compiled. Mechanism first: without the closure story, the fence is just noise. The probe comes last, and only the code field needs to change. Proving the route on a value of no consequence keeps the next steps safe to aim.

What you now have is a proven working payload skeleton (a getter that will return the actual value from the environment for any name you give it). Copperline's own environment is the one that holds the values you want to take. The patched staging twin hasn't come into this yet. Both of them are still ahead of you.

Answer the questions below

  1. Before you trust the sandbox to protect anything, settle its status: per Task 2's timeline, in which calendar year did vm2's upstream maintainers resume work on the project? (Answer Format: a year)

  2. Assemble the probe: point the getter at the container's timezone setting by name, run the workflow, and read the node's output. What value does the escape return? (Answer Format: the value)

Task 6: Recover the Key and Test the Patch

The canary was Copperline's own tripwire. The Automation team put a value into the production container environment such that an environment leak would name itself. They put it where only the container would answer it. No editor setting will render it, and no file that the box serves will contain it. No login you hold will reach it. What answers to the name is the skeleton you saved last.

Priya wants the proof twice over. First comes the canary's read, and with it the instance's encryption key that 0x4bd0's write-up exfiltrated. This lab matched that read byte for byte. Then the identical workflow pointed at the staging twin your hosts line already carries, where the patch either answers for itself or refuses.

The Two Getters

Your probe is the one saved last, and its code field contains what the escape left there. Open it, double-click the Heartbeat node, and the dialog comes up as before.

Replace the code field's contents with this fence, wholesale:

const { getEnvironmentVariable } = require("@langchain/core/utils/env");

const key = getEnvironmentVariable("N8N_ENCRYPTION_KEY");
const canary = getEnvironmentVariable("COPPERLINE_FLAG");

return [{ json: { n8n_encryption_key: key, copperline_canary: canary } }];

One skeleton, two aims. The first getter reads the container's answer for the instance's encryption key (N8N_ENCRYPTION_KEY). The second getter reads COPPERLINE_FLAG (the canary from the opening description). The return line has both of those outputs under separate field names, the outputs declaration leaving the import set untouched so the flat return still runs.

Save with Ctrl+S and then press Execute step from the open dialog (same run path as before). The Output detail renders two columns this time, one per returned key, each holding the container's real value for the name you aimed at it. Read the key's column, then the canary's, and report the canary's value from your own run.

What the Key Is Worth

Priya's question lands before anything else: what did the key cost? Inside n8n, it's the encryption key that everything at rest is filed under. The stored logins of every account and the service secrets its workflows keep all sit encrypted in the data store under that single key. A key alone opens nothing. Set beside a copy of the data store, it decrypts the lot, and that pairing is where the read's real weight sits.

The read was completely silent. No shell opened, no file left the box. The entire thing is in n8n's execution records, in the output you just read.

The write-up claims the same pairing chains further on real deployments, past the data store to the instance itself, a follow-on the lab never demonstrated. On this estate, the honest ledger is simply the two values in your output and nothing more.

The Replay at the Staging Twin

A smoke detector that has never smelled smoke proves nothing, so the test is deliberate: the twin gets a workflow it must refuse. The foothold's promise comes due here: the request surface you watched in the network tab replays from a command-line client, request for request. The replay is shaped after Abraxas Labs' published lab, the disclosure that established where the hidden family executes.

From the box's shell, three lines run it:

curl -s -o automation-starter.json http://automation-files.copperline.thm:8080/automation-starter.json
curl -s -c twin-jar.txt -o /dev/null -X POST -H "Content-Type: application/json" \
  -d '{"emailOrLdapLoginId":"member@n8nlab.thm","password":"Copperline2026"}' \
  http://automation-staging.copperline.thm:5679/rest/login
curl -s -b twin-jar.txt -o refusal-body.json -w "%{http_code}" -X POST \
  -H "Content-Type: application/json" \
  -d @automation-starter.json http://automation-staging.copperline.thm:5679/rest/workflows

The first line pulls the starter file from the snippet store (the same file your editor session imported). The second line signs your member seat into the twin and keeps the session in a cookie file, the seat working as it does on production. The third line posts the create with that file as its body and writes the response body to a second file. The status the twin returned is just that on the terminal.

Read the status first. Then open the refusal body the line wrote out: past its message string sits a top-level meta object with a violations array in it. Each entry in the array carries a kind naming what was attempted with the workflow. The message's opening verb is the gate's own two-way ledger, documented in the community. A node already saved in the workflow draws one verb, and a node new to it draws the other.

The refusal has a name: the twin's release carries the save gate, the backend check that turns away any save carrying the deprecated nodes, and yours never ran one.

Try It Yourself: the refusal is that the create never got there. Look at the twin's own records, and it's all clear. Point your browser at the staging twin's editor, log in as your member seat, and open its Overview list. The record that your replay was trying to create isn't in that list at all. Leave that session open for the read that follows.

The Twin's Own Release

Open the staging twin's editor at http://automation-staging.copperline.thm:5679 and log in with your member seat. From the user menu, select About n8n. The dialog's version row names the release the twin runs.

The fix list on the record is intentionally short, one patch release per line affected. The twin runs the first fixed one on its line, and the About dialog is where Priya's team confirms the fix has arrived.

Retarget then replay: one primitive, two arbiters. The container's environment answered any name asked of it, and the twin turned away the save its release was built to refuse. Reads go first: the control is of no use until the exploit it responds to has been proven. The replay comes last: a refusal leaves nothing to build upon.

You leave with three artifacts. A value proves the environment leakage occurred, a key quantifies it, and a refusal demonstrates the staged patch has bit. All of them are invisible to the estate in the state they're in. The audit's final question is how a quiet read becomes a caught one.

Answer the questions below

  1. Point the second getter at the canary variable COPPERLINE_FLAG in Copperline's vulnerable container, run the workflow again, and read the output. What canary value does the escape return? (Answer Format: the value)

  2. You now hold the key. Priya asks what actually walks out the door with it. An attacker who also copies the instance's data store decrypts every stored login and service secret n8n keeps encrypted at rest. Which single noun does the security write-ups use for those items? (Answer Format: one word)

  3. Now prove the patch: point the same REST flow at the staging twin, replay the login and the workflow create with the identical workflow JSON, and read the response. What HTTP status does the twin answer with? (Answer Format: the status code)

  4. Decode the refusal: the twin's body carries a structured violations array, and your workflow was new to that instance. What kind does the array's first entry record? (Answer Format: one word)

  5. The record lists one patched release per affected line. Which release, the first fixed one on your own line, does the twin carry? (Answer Format: the version)

Task 7: Detect and Patch

Patch day goes quietly, and the quiet is the trap. The save gate refuses every save that adds or modifies one of the deprecated nodes. n8n's security advisory adds the clause the defense story stands on: "workflows already saved with these nodes continue to run unchanged." It behaves like a key recall. The locksmith stops cutting new copies. Every copy already in a pocket still opens the door. That gap is the save/run asymmetry. The gate checks saves. For workflows already saved, runs pass untouched. Nothing in the product points at what was already there, so the sweep starts at patch time.

What the Gate Checks

The fix's pull request adds a deprecated flag to node descriptions, enforced by the backend on every path that writes a workflow: create, update, and import. A config field, blockDeprecated, on by default per the fix commit, backs the check. Refusals arrive as error class DeprecatedNodesError. Your replay drew a 400 refusal body, kind added in its violations array.

The message's leading verb splits the two ways a save meets the gate, as a community write-up documents. Cannot use a means the node is new to the workflow. Cannot modify a means the node already sits in it. That refusal names an existing carrier, a malicious workflow already saved on the instance that carries the retired nodes.

A save made before the patch runs to completion after it: the fix adds no execution check for workflows already saved. The map below has the documented exceptions.

The Detection Map

Sweep the saved workflows. Search the estate's saved workflows for the three retired strings: n8n-nodes-base.function, n8n-nodes-base.functionItem, @n8n/n8n-nodes-langchain.code. The public API's Workflow endpoints under base /api/v1 reach them in bulk, as the endpoint reference documents.

The built-in n8n audit command generates five risk reports. Its Nodes report covers part of the trio by name. The audit's own source lists n8n-nodes-base.function and n8n-nodes-base.functionItem among its official risky nodes, and no LangChain Code node in any list. The audit's documentation nowhere mentions deprecated or hidden nodes. The audit is a useful partial signal, and the sweep still runs on the counts this task teaches.

Watch the save requests. Alert on save-request bodies carrying any of the three strings. A patched gate answers them itself. An unpatched one marks the planting attempt. Two caveats go in the report. No published Sigma rule for this CVE exists in this room's sources. Body logging depends on the reverse proxy.

Mind the batch effects. An n8n import:workflow restore fails all-or-nothing per batch, nothing written. A source-control pull stops at the first failing workflow, so a partial pull is itself the signal. A sub-workflow from inline JSON, a URL or a file fails at execution time under the same create-rule check.

The Hygiene Check

The sweep has a proof on your own estate, as you built a carrier there. Open the Heartbeat record editor and download the workflow's JSON. Save the file where your terminal can find it. Call it heartbeat-carrier.json. That's the name the commands will use.

The nodes array in the file has the type of each node, and the one that's retired is the string you're counting. First count:

grep -c '@n8n/n8n-nodes-langchain.code' heartbeat-carrier.json

A non-zero count is the carrier announcing its presence.

Cover the other two in one pass.

grep -cE 'n8n-nodes-base\.function(Item)?' heartbeat-carrier.json

On that record, it comes back zero; the snippet only had the LangChain version.

At estate scale, the same count over every export becomes the sweep the report owes.

When the Upgrade Cannot Land

The advisory's order puts the upgrade first: "Users should upgrade to one of these versions or later to remediate the vulnerability." The fix list carries one patched release per affected line: 2.42.6, the backport that landed on 2026-10-09, then 2.43.3 and 3.0.1. Release 2.44.0 carries the fix too, which the advisory's "or later" covers.

Where the pin holds, two workarounds apply, and the advisory prices them itself. In the docs' own words, naming the three retired strings in NODES_EXCLUDE stops n8n from loading them at all. Then limit workflow creation and editing permissions to fully trusted users only. The advisory's caveat: "These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures."

The gate even ships a kill switch. N8N_DEPRECATED_NODES_BLOCK=false turns the gate off and restores the vulnerable behavior outright. Treat any runtime flip as a security event. Don't lean on N8N_BLOCK_ENV_ACCESS_IN_NODE either. It's on by default per n8n's hardening notes, and it fences only the ordinary Code node path, not this family.

Priya's Report

The report stays short because the estate answers it. The staging twin runs its line's first fixed release. Production sits one patch behind, at 2.42.5, the release whose container already gave up the instance's encryption key to the escape. Landing 2.42.6 closes the save side. The third entry is the one no release provides: a sweep of the content already saved. The gate flags a saved carrier only when a save touches it. The carrier you built on the estate is one of them.

Closing it is the same check at fleet scale: export every workflow and run the two counts. The gate catches the next save. The sweep catches everything already saved. Between them, the pin's window shuts.

Back to all walkthroughs
Room Icon

n8n: CVE-2026-119408

Escape the n8n vm2 sandbox through a deprecated code node, steal the encryption key, then patch.

medium

50 min

45

User profile photo.
User profile photo.

To access material, start machines and answer questions login.

Priya Raman is head of the Automation team at Copperline Energy (a regional energy operator). Their self-hosted n8n instance is the operational plumbing, in that it's what handles the meter data syncs, the enrichment of outage tickets, the scheduled reporting, etc. The estate is on an older n8n release behind very slow change control, so security releases are effectively on hold. She's had to commission an internal self-audit because no one knows what that pin actually costs.

-2026-119408 is n8n's October 2026 entry in the Common Vulnerabilities and Exposures (CVE) catalog, the public registry where disclosed flaws receive stable identifiers. It is mirrored in the Open Source Vulnerabilities (OSV) record. n8n deprecated certain workflow nodes, marking them as replaced and slated for removal. Those same nodes kept executing user JavaScript in the n8n main process, outside the isolated task runner that ordinary workflow code runs in. GitHub's advisory GHSA-9p7v-45m2-wxgj, titled Deprecated Code Nodes Allow Code Execution in the n8n Main Process, records the defect.

The CVE Numbering Authority record at VulnCheck carries the score: the Common Vulnerability Scoring System (), version 4.0, grades the flaw 8.7 out of ten, High. It also assigns the weakness to CWE-653 (Improper Isolation or Compartmentalization), which names the missing isolation exactly. The score is a number for the question Priya's audit is asking. The same record compresses all of that into one vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N. The letters read as noise now; they won't once the lab has shown you what each input describes.

The lab is, in effect, Priya's estate. One target VM has all three services.

Service Hostname Port
Production n8n, the vulnerable target automation.copperline.thm 5678
Staging n8n, the patched control automation-staging.copperline.thm 5679
Team snippet store automation-files.copperline.thm 8080

Production is still on 2.42.5. Staging is running 2.42.6 (the first patched release on that line). The snippet store serves up the team's exported workflow files via plain HTTP. The three names all point to the same address (MACHINE_IP), which TryHackMe assigns when the machine starts. They're all wired together via a single /etc/hosts entry, which is added once the machine is up.

You have a member seat on default settings, import one of the team's own workflow snippets and watch the code run from a node that shouldn't even be there. The same workflow then ends up on the patched staging twin and is refused at save time there. The audit from that point on is defensive, and you'll work out how that exposure is detected and closed.

The sandbox escape follows 0x4bd0's published write-up and the HTTP request flow follows the lab Abraxas Labs released alongside their disclosure, both credited where the room uses them.

Learning Objectives

This room covers one n8n vulnerability from record to working escape to verified patch. You'll in particular learn how to:

  • Explain the deprecated-node isolation gap and its CVE record.
  • Establish a workflow-creating foothold on default settings.
  • Import and run a workflow that names a hidden node type
  • Trace the sandbox escape to the real environment.
  • Recover environment secrets through the credited escape.
  • Drive the identical workflow at the patched control.
  • Plan detection and mitigation for the exposure

Room Prerequisites

You should be comfortable driving a web app from the browser and reading a request in the dev tools network tab. Basic Linux shell work and curl against an completes the picture. No n8n experience is required, as the room teaches you every n8n concept it uses as it comes up. If you're new to the series, then the earlier rooms in the Recent Threats module cover similar ground and would make a good warm-up, though again you don't need them for this room.

Before you start Task 2, press the Start AttackBox button to start the Attacker machine and press the Start Machine button to start the Target machine so that they are ready when you need them in later tasks.

Set up your virtual environment

To successfully complete this room, you'll need to set up your virtual environment. This involves starting both your AttackBox (if you're not using your VPN) and Lab Machines, ensuring you're equipped with the necessary tools and access to tackle the challenges ahead.
Attacker machine
Status:Off
Lab machine
Status:Off

Take an item off a menu, and the kitchen can still cook it. The order form names the dish rather than the shelf it sits on. In late September 2026, Abraxas Labs published evidence that n8n made the same trade with three of its workflow nodes. The product marked them as replaced, hid them from the node palette, and kept resolving them anyway. A saved workflow names node types by string rather than by menu position, and the palette is only the editor's catalog of what you can drop onto a canvas. Where that reachability leads is the part worth your attention. The hidden nodes execute user JavaScript inside the n8n main process, the one process hosting everything else the instance does.

You met the record in this room's opening: -2026-119408, graded 8.7 under the Common Vulnerability Scoring System (). The same record carries weakness class CWE-653 and the full vector printed once. You met Copperline Energy's premise there too: production pinned to release 2.42.5 while staging holds the patched 2.42.6. This task asks what deprecated actually enforced. The answer decides whether Priya's pinned estate holds a hygiene gap or a foothold waiting for a member login.

Replaced on Paper

n8n deprecated this family without removing it:

  • Function node (n8n-nodes-base.function), the long-standing free-form JavaScript step
  • Function Item node (n8n-nodes-base.functionItem), its per-item sibling
  • LangChain Code node (@n8n/n8n-nodes-langchain.code), the node for AI-chain code, counted among the deprecated code nodes by advisory GHSA-9p7v-45m2-wxgj

The n8n documentation for the Function node states the replacement in one line: the Code node replaced the Function and Function Item nodes. The replacement landed in release 0.198.0, which the npm registry's publish record dates to 2022-10-14. The Code node executes user JavaScript too, just from a different place, and that difference is the vulnerability.

Deprecation did very little indeed. It simply removed the retired definitions from the node palette. Everything else remained as it was. The definitions stayed installed, still registered and still executable. Just not visible.

Where the Legacy Code Actually Runs

Location claims require evidence, and the disclosure provides it. Abraxas Labs ran a very short identifying script in each node class on a stock n8n 2.42.0 build, asking the running process to identify itself. An OS assigns every running process a process ID, and the n8n main process is no different. The script in the hidden Function node reported a process ID matching the main process. Inside the modern Code node, the same JavaScript couldn't identify a process at all and reported hasProcess: false. The task runner that is executing the code is the process at pid 26:

main_pid=7
runner_pid=26
function_pid=7

A process ID match means the same process. The hidden node's code ran where the whole product runs: the main process holds the instance's database connections, credential store, and settings. The Code node's execution landed elsewhere by design, in the isolated task runner n8n delegates user code to over a websocket link. External deployments run it as its own container. Internal mode runs it as a child process that n8n's task-runner documentation labels "insecure by design" and deprecates from 3.0.

Every hardening guard sits on that runner lane. From release 2.0, shipped in December 2025, task runners turn on by default, so ordinary Code node executions run isolated. Environment reads from Code node code are now blocked by default, through N8N_BLOCK_ENV_ACCESS_IN_NODE, as n8n's v2.0 breaking-changes notes record. The runner child also starts with --disallow-code-generation-from-strings and --disable-proto=delete, restrictions on dynamic code generation and prototype tampering. None of it reaches the legacy trio. Its lane was never the runner. Its code executes in the main process, wrapped in vm2, a Node.js sandbox library that runs untrusted JavaScript in a restricted context. CWE-653 names that gap: critical pieces operating without the compartmentalization the design promises.

Hidden Is Not an Access Control

Execution location only matters when a hidden node actually ends up on a canvas, and the palette will never provide one. An n8n workflow is stored as workflow JSON (JavaScript Object Notation), a JSON document containing the nodes, connections, and settings. Each node type within it is a string. When n8n loads a workflow (whether it's saved or imported), it resolves those strings against the registered node definitions (hidden property included). Name it n8n-nodes-base.function in JSON, and the type will resolve and run as it did previously. Abraxas Labs put the finding plainly: "Palette hidden is not an ACL." An access control list (ACL) would check who is asking before refusing anything. The hidden property does none of that. It simply decides what the palette will draw.

The deprecation arrived on 2022-10-14. The backend that enforces it does so by refusing to save or import a workflow that adds one of the three types. The gate did not exist until pull request #31360 merged on 2026-10-08, as part of the fix the CVE record tracks. Between those two dates, the only thing separating a member from the main process was a palette flag. Copperline's pin sits inside that , which is why production still accepts the retired types today.

A With a History

vm2 needs its own timeline. Its maintainers discontinued their own project. The letter published alongside issue #533 on 2023-07-12 calls the situation an escape "so complicated that fixing it seems impossible" and announces "the discontinuation of this project." The same issue was closed as completed on 2025-10-24 with a revival announcement and a v3.10.0 release the same day. The npm registry's record for vm2 lists 3.12.2 as the current release, published 2026-09-08. The project's current README carries an Important Security Disclaimer: "New bypasses will likely be discovered in the future." and "vm2 should not be your only line of defense." The sandbox under Copperline's legacy lane is vm2, discontinued once and revived since. Its README today warns that it must not stand alone.

Who Can Reach It

Task 1 printed the vector once, and one field states the account level an attacker must hold for the attack to apply. The advisory's prerequisite sentence matches Copperline's everyday logins precisely: "an authenticated user with permission to create or modify workflows." A member seat on default instance settings carries that permission on a fresh install, as n8n's instance-roles documentation describes. No misconfigured admin group is needed to put the estate in scope. The member seat the lab issues you is the record's own threat model, not a lab convenience.

Try It Yourself: Task 1's printed vector packs the attack's preconditions into lettered fields, and this task has only read one of them. Walk the string and find the field which tells you whether the attack requires a real person to click, approve, or open anything as part of the journey. Then read the value that follows that field's colon. Knowing that verdict before you go end to end with the attack is worth the minute.

You can now describe the flaw in terms of its anatomy: three node types are marked as replaced and hidden, all of which execute their user code in the main process within a sandbox that has a well-documented history. What you can't do yet is reach one. The palette offers nothing. Copperline's own starter snippet already has one of the hidden type strings in its , and a member seat is sufficient to open the editor that would import it.

Answer the questions below

Task 1 printed the CVE record's CVSS v4.0 vector. Which component of that vector states the privilege level an attacker needs? (Answer Format: the component and its value)

The Code node replaced the Function and Function Item nodes when version 0.198.0 shipped on 2022-10-14, yet the backend gate for the hidden types only merged on 2026-10-08. Roughly how many years stayed open between those two dates? (Answer Format: a whole number)

Every write-up of this flaw opens its prerequisite list at the same unremarkable item: one authenticated account with rights to create workflows, on an instance whose settings nobody hardened. The Abraxas Labs' disclosure proved on a stock build that this alone is the whole prerequisite. The pair is an ordinary member seat on default instance settings, with no admin role anywhere in the chain. A member seat is the user role the platform hands out for free. Default instance settings are the ones a fresh install boots with. Copperline issues that pair, and that is where you now sit. So the next few minutes are the attacker's own problem: prove what this ordinary seat can legitimately reach before you ask it for anything exceptional.

On the Instance by Name

For the attacker, the estate is names, and for this lab it is one address. The hosts file is your machine's private address book. Before it queries a server to find a name, it checks the hosts file. You don't have a DNS server for those names, so you just write the page yourself.

echo "MACHINE_IP automation.copperline.thm automation-staging.copperline.thm automation-files.copperline.thm" | sudo tee -a /etc/hosts

One line ties all three lab names to the same (the editor's production instance, the staging twin, and the team's snippet store). The editor's port is the one you want. Open http://automation.copperline.thm:5678 in the AttackBox browser, and you'll see the login page.

The Seat and the Network Tab

Sign in with member@n8nlab.thm and the password Copperline2026. Before you submit, open the browser's developer tools and stay in the Network tab. The editor is a single-page application (SPA): one page of JavaScript rendering the whole interface. Every button that appears local is actually a request, which is why the request layer lets a member drive the whole instance. The editor and its API share one port, and every call the editor makes passes through one shared prefix.

Submit the form and find the POST that carries your login details. The response is JSON. Read the body, not the status code. The SPA shell will return an HTTP 200 for any path it doesn't route, so a 200 in response to a wrong path tells you absolutely nothing. An editor route will return JSON; the fallback will return HTML.

What the Palette Does Not Show

Now open the panel that lets you add a node to the canvas and search it as a very curious member would. Type in the old Function family name, then the item-level sibling, then the LangChain sibling. Nothing comes up from any of those. Only the modern Code node gives you anything.

That result doesn't contradict Task 2's verdict. Hidden was never behind an access control list (ACL). The flag simply determines what the palette draws. A workflow JSON that names one by string still resolves on the backend. All the search has proven is which half of the story the palette has.

The Reach the Seat Owns

Build the dullest workflow the editor will allow: a Manual Trigger node feeding into the standard Code node with a single line of vanilla JavaScript.

return [{ json: { status: "baseline-ok" } }];

Run it and watch it execute successfully. Nothing here is the vulnerability; this is the baseline against which you measure the contrast. The seat's normal reach is to create and run, all via defaults with no gate of any kind in the way.

Try It Yourself: keep the Network tab open and reload the editor's page. Filter the tab to Fetch/XHR, so the static asset loads disappear, and you're left with the editor's own calls. Confirm those calls share the prefix as the login POST. Then type in a path of your own making under that prefix in the address bar. Compare the answer with a genuine editor call's, content type included. Hold on to what gave the fake one away: the status code and the body disagree about what exists on this server.

A foothold is built in stages, and the relevant stage here is measurement. You can't reason about an exceptional call until you know what an ordinary call gets for free. The surface you saw in the network tab is the same surface that a command-line client can then replay later, request by request. It's that replayable surface which is the observation you want to keep.

Two facts for you. A working member session is still running on automation.copperline.thm in your browser. You can see a request showing the editor talking to its backend. The forbidden node family is not in the palette and is reachable by name from workflow . Priya's team has their starter snippet sitting on the third hostname you pinned. Your session is what imports it, and the same request flow is what drives it elsewhere.

Answer the questions below

Open your browser's developer tools while you log in to the Automation instance and watch the network tab. What path does the editor POST your login to? (Answer Format: a path beginning with a slash)

Your member session is still active in the AttackBox browser, and the team's starter snippet is still waiting on the third hostname you pinned. You've already established what the palette is: a catalog that hides the forbidden nodes and checks nothing else. The snippet's own can in fact name a type that the palette will never provide. What happens when Copperline's very own starter snippet puts the forbidden node on your canvas?

The Snippet on the Third Hostname

Bring the file down before you touch the editor:

curl -s -o automation-starter.json http://automation-files.copperline.thm:8080/automation-starter.json

The file lands in your working directory as the original, untouched file. Take a fresh copy for each experiment, as every deliberate break starts from that file.

Open the vulnerable editor at http://automation.copperline.thm:5678. Start with the fresh New workflow canvas. Bring the file in via the editor's workflow import control and then save. The import adds the file's nodes to the currently open canvas and renames the workflow to the file's name. Saving a new canvas will create the record on this instance. Once the canvas has settled, the node the palette will not give you is already on it. A string in the team's own file is used to place that node there.

As the import is additive rather than replacement, each experiment below commences on a brand new New Workflow canvas with its own edited copy of the original. No canvas ever has the nodes from a previous experiment.

The import brings the file's nodes but leaves the file's wire behind. This canvas has none. The baseline never did: you drew the wire in by hand. A workflow with nothing connected to its trigger will just run the trigger. Give the node its own run: select it and press Execute step (the single node run control on the node card). The run's entry appears in the editor's logs panel. Open that up, and the node's output panel responds with an object containing a status token and a fresh timestamp. Don't go down the command line read route here, as it just outputs n8n's internal storage format, which looks like index soup.

Nothing at import, nothing at save, nothing at run. The silence is the finding. The backend save gate came in with the fix, and this pinned release predates that. An ordinary member seat took us right through the whole path.

Where This Node Prefers Its Code

Select the Heartbeat node and open its JSON. The editor's node view and the file contain the same document. You know where the standard Code node gets its code from the baseline (it's all in one flat field, pulled straight from that). This node has no such field.

The difference is filing. The last task's node had its code simply taped to the front of the cabinet. This node files the same page in a folder inside the cabinet. Only a reader who goes through the folders will see it. Where the ordinary Code node will answer one field name, this node's executable code only resolves at the end of a route of objects.

Walk down through the node's parameters in the JSON until you get to the JavaScript string. That path from the parameters object down to the code is the actual address that the node reads. Adjacent to the nested code in the parameters, you'll find one other thing: an Outputs parameter, which is the output declaration for the node. That's the dock paperwork. The dock is built for the parcel size that the paperwork declares, and an undeclared shape gets rejected. The runner reads that declaration prior to your code even speaking, and without it the expected shape will fall back on an assumption that your flat answer will not meet.

Break It and Read the Runner

An import that already ticks every box says nothing, so have the runner lay out its rules one objection at a time.

The Code's Home

The last task's ordinary Code node had its code in a single flat field (name included). Take a fresh copy of the original and pull the heartbeat's code string out of its nested location and into that flat field. Import the modified copy onto a fresh canvas, save and run. Import accepts, save accepts, run fails with an objection as to which execution step it found no code for. Nothing at all answers at that flat location on that node type. No beat requires a restore, since each one starts fresh.

The Declaration

Then the declaration. Take a fresh copy and delete the whole 'Outputs' parameter from the Heartbeat node's parameters. Import onto a fresh canvas, save and run. The save will still accept it. The runner will not. Its objection is now to the shape of the return. The message tells you precisely what it expected (in words) right where your flat answer was sitting. Read that description on your box and count the nesting it refers to.

Try It Yourself: take another fresh copy of the original. Delete the in-parameters declaration again, then put it back at the node level as an outputs key alongside the node's parameters object. Import onto its own fresh canvas, save and run. Compare what the save does versus what the runner does: the misplaced key saves without a word, and the runner's complaint is still there.

The pattern to follow in the loop is this: let the runner's objection name the missing structure before you do anything to it. The first objection was about a step with no code; the second was about a return shape and left the count to us. One pristine original and one break per import, and every objection was attributable. Two objections on a single run would have been a complete mystery.

Finish on the working version. Take a clean copy of the original untouched version, import it onto its own clean canvas, save, and run it again. The heartbeat comes back. Leave that record saved. That's the one saved last of all the same-named experiments and the one the next task will open. You can now place a node that the palette will refuse to name, import it, save it without a warning, and read its answer from a member seat. What that node's code can reach from where it runs is the very question this instance is set up to answer.

Answer the questions below

Open the imported LangChain Code node's JSON in the editor. What dotted path, starting at the node's parameters object and ending in the JavaScript source the node runs, carries that code? (Answer Format: the full dotted path from the parameters object down to the code)

Your flat, single-item return only runs because the snippet declares the node's main output. Remove that declaration and the runner expects a differently nested shape: how many list levels deep must the return be then? (Answer Format: a number)

The forbidden node is now on the production canvas, running team code under vm2 and answering as any other step would. The whole point of a is to provide a substitution; the code inside runs in a stand-in environment that copies the real one and is effectively walled off. So if the sandbox is substituting a fake environment for the sandboxed code, why does the getter for an allowlisted module still reach the real one?

Where the Sandbox Ends

vm2's protection has an exact edge. The sandbox boundary only covers code that's executing as part of the sandbox call. Anything running inside that call reads the stand-in environment vm2 hands it. process.env comes in as a fake that's been installed by the substitution. The boundary contains everything the script does inside that call.

Compiled before work keeps its origin. A closure is a function that carries the scope it was born in, and such a function will run in its original binding context wherever the call occurs. The substitution is available for code that vm2 compiles. It has no way of re-isolating a module that the outer runtime loaded earlier. Born outside, such a function answers outside.

A hotel card opens only one guest's floor, and its reach stops there. A staff badge issued long before check-in will open the back office when the bearer needs to run an errand. The stand-in environment is the guest's card and the pre-compiled module function is the staff badge.

None of this needs vm2 to fail, and that's what should reshape the trust verdict. The sandbox's own history is on your page already: maintainers who discontinued the project over an escape they judged unfixable, a revival since. The vm2 README still insists it must not stand alone. Caution is the right reading of that record. This escape rides on the sandbox's own invitation.

The Allowlisted Path

The LangChain Code node's sandbox is by no means a sealed room. It has a resolver allowlist for the packages that can be resolved in there, which is appropriate for the node's AI-agent work, where we're going to be loading in trusted libraries. The allowlist covers the langchain package and the entire @langchain/* prefix so @langchain/core is allowlisted by default. Within that sandbox, require("@langchain/core/utils/env") will just answer.

@langchain/core ships an environment getter named getEnvironmentVariable. It lives in the module's environment utilities and calls process.env directly. The line that does it: if (typeof process !== "undefined") return process.env?.[name]; 0x4bd0's write-up records the detail that matters next: the module "was loaded by the outer Node.js runtime before the sandbox started". Its pre-compiled getter still references the real one: the process.env of the main n8n server process.

What's odd about this escape is that no vm2 bypass was found or used, and no boundary was crossed. The require was on the allowlist and the getter's world was fixed at compile time. The write-up applies the same pair to a deployment's secret material. The room takes them to a lower value first so the proof is absolutely free.

Point the Getter at the Timezone

The vehicle is the working Heartbeat record the last task left saved, with your member session still open. Your session's Overview list will contain all of the saved records under one shared name (newest first), so the record that was saved last will be at the top. Open it.

The record opens on its canvas. A single click selects the Heartbeat node. A double-click will open its editor dialog. The dialog lays the node's parameters out as fields, and the code field holds the executable JavaScript where your JSON reading found it.

Select everything in that code field and replace it with this fence, which points the getter at one name (the container's timezone setting).

const { getEnvironmentVariable } = require("@langchain/core/utils/env");

const containerTz = getEnvironmentVariable("GENERIC_TIMEZONE");

return [{ json: { container_timezone: containerTz } }];

The getter answers by the name in its argument. A name the answers returns its value. A name with nothing behind it returns as undefined, and the returned drops that field from the output. The timezone is the one thing we're deliberately targeting, as it proves the route without revealing anything else of significance. The fence just echoes whatever the container returns, and the box supplies the value you get back. The Outputs parameter remains in the node's parameters as it was, and the single-item return still operates on it.

Save with Ctrl+S. The save updates the record you opened, and the list remains unchanged. With the dialog still open, press Execute step. The run appears in the logs panel below the canvas, with the node's entry already selected and its Output detail rendered immediately. In the table view, the output shows a single row, and the timezone value appears in that row. The Input pane in the still-open dialog shows the same item. Run for run, the node's own run figure is a beat longer than the heartbeat's. The probe is doing the actual resolving work, so that longer beat is the work.

Try It Yourself: the contract has a second half that's definitely worth a look at. Swap the quoted name in the fence for a made-up word no container variable answers, save, and press Execute step as before. Read the Output row and compare it to the timezone run. Restore the timezone's name afterward, save again, and leave the working probe in place.

A sandbox boundary is defined by where substitution kicks in, so the first question about sandboxed code is what names it's allowed to load and where those modules were compiled. Mechanism first: without the closure story, the fence is just noise. The probe comes last, and only the code field needs to change. Proving the route on a value of no consequence keeps the next steps safe to aim.

What you now have is a proven working payload skeleton (a getter that will return the actual value from the environment for any name you give it). Copperline's own environment is the one that holds the values you want to take. The patched staging twin hasn't come into this yet. Both of them are still ahead of you.

Answer the questions below

Before you trust the sandbox to protect anything, settle its status: per Task 2's timeline, in which calendar year did vm2's upstream maintainers resume work on the project? (Answer Format: a year)

Assemble the probe: point the getter at the container's timezone setting by name, run the workflow, and read the node's output. What value does the escape return? (Answer Format: the value)

The canary was Copperline's own tripwire. The Automation team put a value into the production environment such that an environment leak would name itself. They put it where only the container would answer it. No editor setting will render it, and no file that the box serves will contain it. No login you hold will reach it. What answers to the name is the skeleton you saved last.

Priya wants the proof twice over. First comes the canary's read, and with it the instance's encryption key that 0x4bd0's write-up exfiltrated. This lab matched that read byte for byte. Then the identical workflow pointed at the staging twin your hosts line already carries, where the patch either answers for itself or refuses.

The Two Getters

Your probe is the one saved last, and its code field contains what the escape left there. Open it, double-click the Heartbeat node, and the dialog comes up as before.

Replace the code field's contents with this fence, wholesale:

const { getEnvironmentVariable } = require("@langchain/core/utils/env");

const key = getEnvironmentVariable("N8N_ENCRYPTION_KEY");
const canary = getEnvironmentVariable("COPPERLINE_FLAG");

return [{ json: { n8n_encryption_key: key, copperline_canary: canary } }];

One skeleton, two aims. The first getter reads the container's answer for the instance's encryption key (N8N_ENCRYPTION_KEY). The second getter reads COPPERLINE_FLAG (the canary from the opening description). The return line has both of those outputs under separate field names, the outputs declaration leaving the import set untouched so the flat return still runs.

Save with Ctrl+S and then press Execute step from the open dialog (same run path as before). The Output detail renders two columns this time, one per returned key, each holding the container's real value for the name you aimed at it. Read the key's column, then the canary's, and report the canary's value from your own run.

What the Key Is Worth

Priya's question lands before anything else: what did the key cost? Inside n8n, it's the encryption key that everything at rest is filed under. The stored logins of every account and the service secrets its workflows keep all sit encrypted in the data store under that single key. A key alone opens nothing. Set beside a copy of the data store, it decrypts the lot, and that pairing is where the read's real weight sits.

The read was completely silent. No shell opened, no file left the box. The entire thing is in n8n's execution records, in the output you just read.

The write-up claims the same pairing chains further on real deployments, past the data store to the instance itself, a follow-on the lab never demonstrated. On this estate, the honest ledger is simply the two values in your output and nothing more.

The Replay at the Staging Twin

A smoke detector that has never smelled smoke proves nothing, so the test is deliberate: the twin gets a workflow it must refuse. The foothold's promise comes due here: the request surface you watched in the network tab replays from a command-line client, request for request. The replay is shaped after Abraxas Labs' published lab, the disclosure that established where the hidden family executes.

From the box's shell, three lines run it:

curl -s -o automation-starter.json http://automation-files.copperline.thm:8080/automation-starter.json
curl -s -c twin-jar.txt -o /dev/null -X POST -H "Content-Type: application/json" \
  -d '{"emailOrLdapLoginId":"member@n8nlab.thm","password":"Copperline2026"}' \
  http://automation-staging.copperline.thm:5679/rest/login
curl -s -b twin-jar.txt -o refusal-body.json -w "%{http_code}" -X POST \
  -H "Content-Type: application/json" \
  -d @automation-starter.json http://automation-staging.copperline.thm:5679/rest/workflows

The first line pulls the starter file from the snippet store (the same file your editor session imported). The second line signs your member seat into the twin and keeps the session in a cookie file, the seat working as it does on production. The third line posts the create with that file as its body and writes the response body to a second file. The status the twin returned is just that on the terminal.

Read the status first. Then open the refusal body the line wrote out: past its message string sits a top-level meta object with a violations array in it. Each entry in the array carries a kind naming what was attempted with the workflow. The message's opening verb is the gate's own two-way ledger, documented in the community. A node already saved in the workflow draws one verb, and a node new to it draws the other.

The refusal has a name: the twin's release carries the save gate, the backend check that turns away any save carrying the deprecated nodes, and yours never ran one.

Try It Yourself: the refusal is that the create never got there. Look at the twin's own records, and it's all clear. Point your browser at the staging twin's editor, log in as your member seat, and open its Overview list. The record that your replay was trying to create isn't in that list at all. Leave that session open for the read that follows.

The Twin's Own Release

Open the staging twin's editor at http://automation-staging.copperline.thm:5679 and log in with your member seat. From the user menu, select About n8n. The dialog's version row names the release the twin runs.

The fix list on the record is intentionally short, one patch release per line affected. The twin runs the first fixed one on its line, and the About dialog is where Priya's team confirms the fix has arrived.

Retarget then replay: one primitive, two arbiters. The container's environment answered any name asked of it, and the twin turned away the save its release was built to refuse. Reads go first: the control is of no use until the exploit it responds to has been proven. The replay comes last: a refusal leaves nothing to build upon.

You leave with three artifacts. A value proves the environment leakage occurred, a key quantifies it, and a refusal demonstrates the staged patch has bit. All of them are invisible to the estate in the state they're in. The audit's final question is how a quiet read becomes a caught one.

Answer the questions below

Point the second getter at the canary variable COPPERLINE_FLAG in Copperline's vulnerable container, run the workflow again, and read the output. What canary value does the escape return? (Answer Format: the value)

You now hold the key. Priya asks what actually walks out the door with it. An attacker who also copies the instance's data store decrypts every stored login and service secret n8n keeps encrypted at rest. Which single noun does the security write-ups use for those items? (Answer Format: one word)

Now prove the patch: point the same REST flow at the staging twin, replay the login and the workflow create with the identical workflow JSON, and read the response. What HTTP status does the twin answer with? (Answer Format: the status code)

Decode the refusal: the twin's body carries a structured violations array, and your workflow was new to that instance. What kind does the array's first entry record? (Answer Format: one word)

The record lists one patched release per affected line. Which release, the first fixed one on your own line, does the twin carry? (Answer Format: the version)

Patch day goes quietly, and the quiet is the trap. The save gate refuses every save that adds or modifies one of the deprecated nodes. n8n's security advisory adds the clause the defense story stands on: "workflows already saved with these nodes continue to run unchanged." It behaves like a key recall. The locksmith stops cutting new copies. Every copy already in a pocket still opens the door. That gap is the save/run asymmetry. The gate checks saves. For workflows already saved, runs pass untouched. Nothing in the product points at what was already there, so the sweep starts at patch time.

What the Gate Checks

The fix's pull request adds a deprecated flag to node descriptions, enforced by the backend on every path that writes a workflow: create, update, and import. A config field, blockDeprecated, on by default per the fix commit, backs the check. Refusals arrive as error class DeprecatedNodesError. Your replay drew a 400 refusal body, kind added in its violations array.

The message's leading verb splits the two ways a save meets the gate, as a community write-up documents. Cannot use a means the node is new to the workflow. Cannot modify a means the node already sits in it. That refusal names an existing carrier, a malicious workflow already saved on the instance that carries the retired nodes.

A save made before the patch runs to completion after it: the fix adds no execution check for workflows already saved. The map below has the documented exceptions.

The Detection Map

Sweep the saved workflows. Search the estate's saved workflows for the three retired strings: n8n-nodes-base.function, n8n-nodes-base.functionItem, @n8n/n8n-nodes-langchain.code. The public API's Workflow endpoints under base /api/v1 reach them in bulk, as the endpoint reference documents.

The built-in n8n audit command generates five risk reports. Its Nodes report covers part of the trio by name. The audit's own source lists n8n-nodes-base.function and n8n-nodes-base.functionItem among its official risky nodes, and no LangChain Code node in any list. The audit's documentation nowhere mentions deprecated or hidden nodes. The audit is a useful partial signal, and the sweep still runs on the counts this task teaches.

Watch the save requests. Alert on save-request bodies carrying any of the three strings. A patched gate answers them itself. An unpatched one marks the planting attempt. Two caveats go in the report. No published Sigma rule for this CVE exists in this room's sources. Body logging depends on the reverse proxy.

Mind the batch effects. An n8n import:workflow restore fails all-or-nothing per batch, nothing written. A source-control pull stops at the first failing workflow, so a partial pull is itself the signal. A sub-workflow from inline JSON, a URL or a file fails at execution time under the same create-rule check.

The Hygiene Check

The sweep has a proof on your own estate, as you built a carrier there. Open the Heartbeat record editor and download the workflow's JSON. Save the file where your terminal can find it. Call it heartbeat-carrier.json. That's the name the commands will use.

The nodes array in the file has the type of each node, and the one that's retired is the string you're counting. First count:

grep -c '@n8n/n8n-nodes-langchain.code' heartbeat-carrier.json

A non-zero count is the carrier announcing its presence.

Cover the other two in one pass.

grep -cE 'n8n-nodes-base\.function(Item)?' heartbeat-carrier.json

On that record, it comes back zero; the snippet only had the LangChain version.

At estate scale, the same count over every export becomes the sweep the report owes.

When the Upgrade Cannot Land

The advisory's order puts the upgrade first: "Users should upgrade to one of these versions or later to remediate the vulnerability." The fix list carries one patched release per affected line: 2.42.6, the backport that landed on 2026-10-09, then 2.43.3 and 3.0.1. Release 2.44.0 carries the fix too, which the advisory's "or later" covers.

Where the pin holds, two workarounds apply, and the advisory prices them itself. In the docs' own words, naming the three retired strings in NODES_EXCLUDE stops n8n from loading them at all. Then limit workflow creation and editing permissions to fully trusted users only. The advisory's caveat: "These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures."

The gate even ships a kill switch. N8N_DEPRECATED_NODES_BLOCK=false turns the gate off and restores the vulnerable behavior outright. Treat any runtime flip as a security event. Don't lean on N8N_BLOCK_ENV_ACCESS_IN_NODE either. It's on by default per n8n's hardening notes, and it fences only the ordinary Code node path, not this family.

Priya's Report

The report stays short because the estate answers it. The staging twin runs its line's first fixed release. Production sits one patch behind, at 2.42.5, the release whose already gave up the instance's encryption key to the escape. Landing 2.42.6 closes the save side. The third entry is the one no release provides: a sweep of the content already saved. The gate flags a saved carrier only when a save touches it. The carrier you built on the estate is one of them.

Closing it is the same check at fleet scale: export every workflow and run the two counts. The gate catches the next save. The sweep catches everything already saved. Between them, the pin's window shuts.