n8n legacy expression engine allows code execution via JSON.stringify override
What this means
An attacker with access to n8n expressions can run arbitrary code on the server where n8n runs. This could expose sensitive data, modify or delete workflows and data, or allow further attacks on connected systems. The risk is highest if n8n has access to credentials, databases, or external APIs.
SecurityElites Manager Brief: the decision in one minute
An attacker who can access n8n expressions in older versions can run code on your server by overriding a global function. This risks data theft and system compromise. Upgrade immediately to version 1.123.76, 2.37.7, 2.38.2 or later, or switch to the vm expression engine now.
| SecurityElites Fix-First Score | 43 of 100 Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity. |
|---|---|
| SecurityElites fix window | Within 30 days High severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | Platform engineering or DevOps team (whoever manages n8n infrastructure). |
| Likely effort | About 15 to 30 minutes: check which expression engine you use, upgrade n8n to the fixed version, and restart. It may take longer if you run n8n across multiple machines or in a container orchestration system. |
Questions to ask your team or supplier
- Which version of n8n are we running, and are we using the legacy or vm expression engine?
- Who has access to create or edit n8n expressions and workflows, and do we trust all of them?
- What sensitive data, APIs, and systems does our n8n instance have access to, and what would happen if an attacker gained code execution there?
Message you can forward to the owning team
Security notice: n8n legacy expression engine allows code execution via JSON.stringify override (CVE-2026-86083)
Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to n8n 2.38.2 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2026-86083-n8n-legacy-expression-engine-allows-code-execution-via-json-stringify/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01736What is at stake in your AI setup
- Keys and secrets for external APIs and AI providers that n8n stores and uses in workflows could be extracted by malicious code execution.
- Prompts, chat history, and AI model parameters used in n8n workflows could be read or modified by an attacker with code execution.
- Tools and systems that n8n agents are connected to (databases, APIs, file systems) could be accessed or manipulated by exploited expressions.
- Training or retrieval data used in n8n AI nodes could be exfiltrated or poisoned by an attacker who gains code execution.
Who is exposed
- n8n instances using the legacy expression engine with untrusted user access
- Teams running n8n version 1.123.75 or earlier
- Teams running n8n version 2.0.0 to 2.37.6
- Teams running n8n version 2.38.0 to 2.38.1
Upgrades you need
| Software | Affected versions | Move to |
|---|---|---|
| n8n npm | Every version before 1.123.76; 2.38.0 up to, but not including, 2.38.2; 2.0.0 up to, but not including, 2.37.7 | 2.38.2 or later |
Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: n8n 1.123.76, 2.37.7, 2.38.2.
Am I affected?
Enter the version you run. Nothing you type is stored.
SecurityElites Developer Brief: the technical picture
| Is it being attacked | No known attacks and no public attack code when CISA last reviewed it |
|---|---|
| Where the attacker must be | Anywhere that can reach it over a network, including the internet if it is exposed |
| Account needed | An ordinary user account |
| Does a person have to do something | No. It works without anyone clicking or opening anything |
| How hard it is to do | Easy. It works reliably once the attacker can reach it |
| Risk of: data being read | High |
| Risk of: data or settings being changed | High |
| Risk of: the service being taken down | High |
| Can attackers automate it at scale | No, according to CISA. Each target needs manual work |
| How much control an attacker gains | Total control of the affected software, according to CISA |
Read from the official severity rating: CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Kind of coding mistake
- CWE-94: code can be injected
If you cannot upgrade today
- Set the environment variable `N8N_EXPRESSION_ENGINE=vm` to use the safer expression engine. This does not fix the vulnerability but prevents the legacy engine from being exploited.
- Restrict access to n8n to fully trusted users only until you upgrade.
- Run the n8n process under a low-privilege user account so that if code execution does occur, the attacker has fewer permissions on the server.
Signs it may already have been used against you
- Search n8n workflow and execution logs for expressions containing `JSON.stringify` or attempts to override global variables like `global.JSON` or `globalThis.JSON`.
- Look for workflows created or modified by users who do not normally create workflows, or workflows with suspicious expression nodes that do not match your organization's normal workflow patterns.
- Check system logs on the n8n server for unexpected process execution or child processes spawned from the n8n process that do not match normal operation.
- Review audit logs for activities that coincide with workflow creation or expression changes, particularly from users who should not have high privileges.
Log searches to start from
Search for suspicious expressions (field names must be adapted to your logs)Splunk
source="n8n*" (expression OR workflow) (JSON.stringify OR globalThis OR global.JSON) | stats count by user, workflowSearch for expression engine logs (field names must be adapted to your logs)Elastic
process.name:n8n* AND (message:"JSON.stringify" OR message:"globalThis") | groupby user, timestampWritten with AI as a starting point. Review them and change the index and field names to match your own logs before you rely on the result.
SecurityElites Fix Guide: step by step
- Find the n8n version you are runningLog in to your n8n web interface and go to Settings or About. Note the version number displayed. Alternatively, if you deployed n8n via npm or Docker, check the installed package version or container image tag.
- Check which expression engine is in useCheck whether the environment variable `N8N_EXPRESSION_ENGINE` is set to `legacy` or not set at all (which defaults to legacy in older versions). You can check this in your deployment configuration, Docker Compose file, Kubernetes manifests, or systemd service file. If you see `N8N_EXPRESSION_ENGINE=vm`, you are already using the safer engine.
- If you must delay the upgrade, apply a temporary workaroundSet the environment variable `N8N_EXPRESSION_ENGINE=vm` before n8n starts. This switches to the safer expression engine. This is not a full fix and should only be used while you prepare to upgrade. You must still upgrade as soon as possible.
- Back up your n8n data and workflowsExport or snapshot your n8n database and workflow files. This ensures you can recover if the upgrade has unexpected effects.
- Upgrade n8n to the fixed versionDownload and install n8n version 1.123.76, 2.37.7, or 2.38.2 or later, depending on which major version you are on. If you use npm, run the upgrade command provided by your package manager. If you use Docker, pull the fixed image tag and redeploy.
- Restart n8nStop the n8n process or service, then start it again. If n8n is running in Docker or Kubernetes, restart the pod or container.
- Verify the upgrade was successfulLog in to n8n and check that the version number displayed in Settings or About matches the fixed version you installed (1.123.76, 2.37.7, 2.38.2, or later).
- Review access and audit logs if availableCheck whether anyone with access to n8n expressions might have exploited this before the fix. Look for unusual workflows, expressions that override global variables, or unexpected data access in your n8n activity logs or audit trail.
How to confirm it is fixed: Log in to n8n and confirm the version shown in Settings or About is 1.123.76 or later (for version 1.x), 2.37.7 or later (for version 2.37.x), or 2.38.2 or later (for version 2.38.x or later).
SecurityElites Quick Fixes: copy and paste
Upgrade n8n with npmupgrade
npm install n8n@2.38.2
npm ls n8nCheck n8n version via npmfor this issue
npm list n8nCheck environment variable (Linux/macOS)for this issue
echo $N8N_EXPRESSION_ENGINESet safer expression engine in Docker Composefor this issue
services:
n8n:
image: n8n:latest
environment:
N8N_EXPRESSION_ENGINE: vmRun the service in a locked-down containergeneral hardening
docker run --read-only --cap-drop ALL \
--security-opt no-new-privileges --user 1000:1000 \
-p 127.0.0.1:8080:8080 YOUR_IMAGETest in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.
Let your AI coding assistant do the upgrade
Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.
Instruction for your coding assistant
You are helping me fix a security vulnerability (CVE-2026-86083) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n - n8n (npm): must be 2.38.2 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.SecurityElites Incident Drill: could your team handle this?
Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.
Ticket for your backlog
Paste into Jira, GitHub Issues or any tracker that reads Markdown.
Ready-made ticket
## n8n legacy expression engine allows code execution via JSON.stringify override (CVE-2026-86083)
**Severity:** High | **SE Fix-First Score:** 43/100 | **Fix window:** Within 30 days
**Record:** SE-AIV-01736 https://securityelites.com/ai-vulnerabilities/cve-2026-86083-n8n-legacy-expression-engine-allows-code-execution-via-json-stringify/
### Why this matters
An attacker with access to n8n expressions can run arbitrary code on the server where n8n runs. This could expose sensitive data, modify or delete workflows and data, or allow further attacks on connected systems. The risk is highest if n8n has access to credentials, databases, or external APIs.
### What to do
1. Find the n8n version you are running
2. Check which expression engine is in use
3. If you must delay the upgrade, apply a temporary workaround
4. Back up your n8n data and workflows
5. Upgrade n8n to the fixed version
6. Restart n8n
7. Verify the upgrade was successful
8. Review access and audit logs if available
Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-86083-n8n-legacy-expression-engine-allows-code-execution-via-json-stringify/
### Done when
- [ ] n8n is at 2.38.2 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Log in to n8n and confirm the version shown in Settings or About is 1.123.76 or later (for version 1.x), 2.37.7 or later (for version 2.37.x), or 2.38.2 or later (for version 2.38.x or later).
- [ ] Logs were checked for signs of earlier use
SecurityElites Fix Tracker
Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.
Related vulnerabilities
In the same software
- n8n OpenAI node bypasses domain restrictions on model search High · CVE-2026-86082
- n8n Git node can freeze the instance with a crafted path High · CVE-2026-86081
- n8n OAuth registration accepts unlimited field sizes, filling the database High · CVE-2026-86075
- n8n expression compiler can run arbitrary code through class field names High · CVE-2026-86076
- n8n Edit Fields node can crash the whole instance with a bad field name High · CVE-2026-72749
- n8n Edit Image node can write files outside its working directory High · CVE-2026-72762
The same kind of mistake in other AI tools
- Langflow OSS allows arbitrary code execution through tool listing without admin check High · CVE-2026-128876
- Langflow OSS can run arbitrary code via tool-call interface before admin check High · CVE-2026-128867
- Langflow OSS allows remote code execution through improper code handling High · CVE-2026-127065
- Langflow OSS allows authenticated users to run arbitrary code High · CVE-2026-122088
- Langflow OSS allows authenticated users to run any command on the server High · CVE-2026-120601
Change history
- 10 Sep 2026: Made public
- 2 Dec 2026: Published
Official record
## ImpactTwo stages of expression code generation built source text by calling the global `JSON.stringify` at generation time: the compiler when printing synthetic string literals, and the isolate bridge when interpolating a timezone value into its per-evaluation wrapper. An expression that replaced that global therefore changed the code that was subsequently generated and executed, turning literal data into executable source. The patch renders both code-generation stages through a reference captured at module load, so a later change to global state cannot alter the generated source.This vulnerability only affects instances running the legacy expression engine. The `vm` expression engine, which is the default on the patched releases, is not affected.## PatchesThe issue has been fixed in n8n versions 1.123.76, 2.37.7, and 2.38.2. Users should upgrade to one of these versions or later to remediate the vulnerability.## WorkaroundsIf upgrading is not immediately possible, administrators should consider the following temporary mitigations: - Set the environment variable `N8N_EXPRESSION_ENGINE=vm` to switch to the vm expression engine, which is not affected by this vulnerability. - Restrict n8n instance access to fully trusted users only. - Ensure the n8n process runs under a dedicated low-privilege OS user account to limit the impact of any command execution.These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Weakness type: CWE-94
Use this record in your own tools
Get this record as JSON
curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-86083For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker
The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 2 Dec 2026. Read the vendor advisory before changing a production system.