n8n Chat Trigger allows injected JavaScript to run as a logged-in user
What this means
A person with permission to edit workflows can inject malicious code that runs in the browser when another logged-in user visits a chat link. This code runs with the visitor's n8n account privileges and can read their data, change settings, create new workflows, or take other actions they could do.
SecurityElites Manager Brief: the decision in one minute
An n8n user with edit rights can hide malicious code in a chat link that steals data or takes over accounts of anyone who clicks it. You need to upgrade n8n immediately or restrict who can edit workflows.
| 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 or infrastructure team that manages n8n deployment. |
| Likely effort | About 15 to 30 minutes: check which version you run, upgrade to the fixed version, and restart n8n. It may take longer if you have multiple n8n instances or if the upgrade requires other dependency changes. |
Questions to ask your team or supplier
- Who in your team has permission to create and edit n8n workflows, and do you trust all of them?
- Have you reviewed the webhookId values in any Chat Trigger nodes to see if they look normal?
- Do you have logs or monitoring in place to detect when workflows are modified or new Chat Triggers are created?
Message you can forward to the owning team
Security notice: n8n Chat Trigger allows injected JavaScript to run as a logged-in user (CVE-2026-54302)
Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to n8n 2.26.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-54302-n8n-chat-trigger-allows-injected-javascript-to-run-as/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01714What is at stake in your AI setup
- Chat history and conversation data: injected code can read conversations between users and AI agents connected through the Chat Trigger.
- Connected tools and system access: if the workflow connects to APIs, databases, or other systems, the attacker's code can abuse those connections using the victim's session.
- Workflow definitions: injected code can read or modify the logic of workflows, including prompts, model choices, and tool configurations.
Who is exposed
- n8n instances running any version before 1.123.55, or versions 2.0.0-rc.0 through 2.25.6, or 2.26.0 through 2.26.1.
- Teams where users who are not fully trusted have permission to create or edit workflows.
- Chat Trigger nodes that are exposed to external users or other team members.
Upgrades you need
| Software | Affected versions | Move to |
|---|---|---|
| n8n npm | Every version before 1.123.55; 2.26.0 up to, but not including, 2.26.2; 2.0.0-rc.0 up to, but not including, 2.25.7 | 2.26.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.55, 2.25.7, 2.26.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 | Yes. Someone has to click, open or approve something |
| 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 | Limited |
| Risk of: the service being taken down | None |
| Can attackers automate it at scale | No, according to CISA. Each target needs manual work |
| How much control an attacker gains | Partial control, according to CISA |
Read from the official severity rating: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N
Kind of coding mistake
- CWE-79: script can be injected into a web page
If you cannot upgrade today
- Until you upgrade, restrict workflow creation and edit permissions to only fully trusted users.
- Disable the Chat Trigger node by adding `@n8n/n8n-nodes-langchain.chatTrigger` to the `NODES_EXCLUDE` environment variable and restart n8n. This stops the flaw from being used but also stops all chat triggers working.
Signs it may already have been used against you
- Check n8n audit logs or database for new Chat Trigger nodes added during the time before you upgraded.
- Look for Chat Trigger workflows with unusual or suspicious webhookId values.
- Review browser console logs on client machines for unexpected JavaScript errors or network requests when users visit chat URLs.
- Check n8n's database or logs for modifications to workflow definitions that you did not authorize.
SecurityElites Fix Guide: step by step
- Find the installed n8n versionLog in to your n8n instance. Go to Settings > About or check the version displayed in the top menu. Write down the exact version number.
- Check if your version is affectedIf your version is before 1.123.55, or is between 2.0.0-rc.0 and 2.25.6, or is between 2.26.0 and 2.26.1, you are affected. If your version is 1.123.55 or later, 2.25.7 or later, or 2.26.2 or later, you are fixed.
- Back up your n8n dataExport your workflows and credentials or take a backup of your database. This protects you in case the upgrade has unexpected effects.
- Upgrade n8n to a fixed versionUpgrade to version 1.123.55, 2.25.7, 2.26.2, or any later version. Follow your normal process to deploy the new version (npm update, Docker image pull, or package manager update).
- Restart n8nStop and start your n8n service to load the new code. Check that it starts without errors and that you can log in.
- Verify the fix is in placeLog in and check the version number again in Settings > About. It must be 1.123.55 or later, 2.25.7 or later, or 2.26.2 or later.
- Review workflow edit permissionsCheck who has permission to create and edit workflows. Remove these permissions from users who do not need them, or move untrusted users to a separate n8n instance.
- Check for signs the flaw was already usedReview the list of Chat Trigger nodes and any recent changes to workflows. Look for any unexpected webhookId values or new workflows created by users who do not normally create them. Check n8n logs for unusual activity around the time the instance was at risk.
How to confirm it is fixed: Log in to n8n and check that the version shown in Settings > About is 1.123.55 or later, 2.25.7 or later, or 2.26.2 or later.
SecurityElites Quick Fixes: copy and paste
Upgrade n8n with npmupgrade
npm install n8n@2.26.2
npm ls n8nCheck n8n version via npmfor this issue
npm list n8nA starting content security policy (nginx)general hardening
add_header Content-Security-Policy "default-src 'self'; object-src 'none'; base-uri 'self'" always;Test 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-54302) 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.26.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 Chat Trigger allows injected JavaScript to run as a logged-in user (CVE-2026-54302)
**Severity:** High | **SE Fix-First Score:** 43/100 | **Fix window:** Within 30 days
**Record:** SE-AIV-01714 https://securityelites.com/ai-vulnerabilities/cve-2026-54302-n8n-chat-trigger-allows-injected-javascript-to-run-as/
### Why this matters
A person with permission to edit workflows can inject malicious code that runs in the browser when another logged-in user visits a chat link. This code runs with the visitor's n8n account privileges and can read their data, change settings, create new workflows, or take other actions they could do.
### What to do
1. Find the installed n8n version
2. Check if your version is affected
3. Back up your n8n data
4. Upgrade n8n to a fixed version
5. Restart n8n
6. Verify the fix is in place
7. Review workflow edit permissions
8. Check for signs the flaw was already used
Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-54302-n8n-chat-trigger-allows-injected-javascript-to-run-as/
### Done when
- [ ] n8n is at 2.26.2 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Log in to n8n and check that the version shown in Settings > About is 1.123.55 or later, 2.25.7 or later, or 2.26.2 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 legacy expression engine allows code execution via JSON.stringify override High · CVE-2026-86083
- 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
The same kind of mistake in other AI tools
- AutomatorWP can store malicious scripts in log entries that run in users' browsers High · CVE-2026-137138
- n8n can run JavaScript in a user's browser when they open a crafted workflow High · CVE-2026-65592
- n8n HTML preview can run attacker scripts with user permissions High · CVE-2026-65597
- n8n webhook node can run JavaScript as an authenticated user High · CVE-2026-54301
- n8n script injection in OAuth notification allows credential theft High · CVE-2026-42235
Change history
- 16 Jun 2026: Made public
- 2 Dec 2026: Published
Official record
## Impact An authenticated user with workflow edit access could inject arbitrary JavaScript into the Chat Trigger's generated page by setting a malicious `webhookId`. When a logged-in user visited the chat URL, the injected code executed in the n8n origin with that user's session privileges.## Patches The issue has been fixed in n8n versions 1.123.55, 2.25.7, and 2.26.2. Users should upgrade to one of these versions or later to remediate the vulnerability.## Workarounds If upgrading is not immediately possible, administrators should consider the following temporary mitigations: - Limit workflow creation and editing permissions to fully trusted users only. - Disable the Chat Trigger node by adding `@n8n/n8n-nodes-langchain.chatTrigger` to the `NODES_EXCLUDE` environment variable.These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Weakness type: CWE-79
Use this record in your own tools
Get this record as JSON
curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-54302For 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 3 Dec 2026. Read the vendor advisory before changing a production system.