n8n script injection in OAuth notification allows credential theft
What this means
An attacker can register a malicious OAuth client and inject code that runs in another user's browser when they revoke access. This code can steal login tokens, change workflows, or give the attacker admin rights to n8n.
SecurityElites Manager Brief: the decision in one minute
n8n versions before 1.123.32, 2.17.0–2.17.3, and 2.18.0 have a script injection flaw in OAuth notifications. An attacker can inject code that steals login tokens and credentials when users revoke OAuth access. You must upgrade all affected instances to fixed versions 1.123.32, 2.17.4, or 2.18.1 or later immediately.
| 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 managing n8n infrastructure. |
| Likely effort | About 30 minutes per n8n instance: download the fixed version, upgrade, and restart. Longer if you have many instances or need to test in a staging environment first. |
Questions to ask your team or supplier
- Do we have a process to track and audit all registered OAuth clients in n8n? Do we review them regularly?
- Have any users reported unusual activity or unexpected clicks after revoking OAuth access in the past month?
- Can we test the upgrade in a staging environment before deploying to production to minimize risk?
Message you can forward to the owning team
Security notice: n8n script injection in OAuth notification allows credential theft (CVE-2026-42235)
Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to n8n 2.18.1 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-42235-n8n-script-injection-in-oauth-notification-allows-credential-theft/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01719What is at stake in your AI setup
- API keys and credentials stored in n8n: compromised credentials can be used to access external AI services, models, or data sources connected to workflows.
- Workflows and automation logic: modified workflows could change how AI integrations work or redirect requests to attacker-controlled systems.
- LLM prompts and instructions: attackers could read or alter prompts used to call language models, potentially extracting sensitive instructions or modifying behavior.
Who is exposed
- n8n instances running version 1.123.31 or earlier
- n8n instances running version 2.17.0 to 2.17.3
- n8n instances running version 2.18.0
- Any n8n instance with MCP server enabled and exposed to the internet or untrusted networks
Upgrades you need
| Software | Affected versions | Move to |
|---|---|---|
| n8n npm | Every version before 1.123.32; 2.18.0 up to, but not including, 2.18.1; 2.17.0 up to, but not including, 2.17.4 | 2.18.1 or later |
Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: n8n 1.123.32, 2.17.4, 2.18.1.
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 | None. No login is needed |
| Does a person have to do something | Yes. Someone has to click, open or approve something |
| How hard it is to do | Hard. It depends on conditions the attacker does not control |
| Risk of: data being read | High |
| Risk of: data or settings being changed | High |
| Risk of: the service being taken down | Limited |
| 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:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:L
Kind of coding mistake
- CWE-79: script can be injected into a web page
- CWE-87
If you cannot upgrade today
- Restrict access to the n8n instance and OAuth registration endpoint to trusted users and networks only. Use a firewall or VPN to limit who can register OAuth clients.
- Disable MCP server functionality if it is not actively in use. This removes the attack surface until you can upgrade.
- These are temporary measures only and do not fully fix the problem. Upgrade as soon as possible.
Signs it may already have been used against you
- Review browser console logs and network traffic for unexpected JavaScript execution or errors during OAuth revocation.
- Check n8n audit logs for sessions with unusual activity (workflow edits, credential access, or privilege changes) around the time users revoked OAuth access.
- Look for toast notifications or user reports of unexpected clicks or alerts when revoking OAuth access.
SecurityElites Fix Guide: step by step
- Find where n8n is runningList all servers and containers where n8n is installed. Check npm installations with npm ls n8n and Docker containers with docker ps | grep n8n. Note the current version of each instance.
- Check the current n8n versionRun npm list n8n or docker exec npm list n8n to see the installed version. Record all version numbers found.
- Back up configuration and workflowsExport or snapshot all n8n workflows, credentials, and database before making any changes. This protects against data loss during upgrade.
- Upgrade n8n to a fixed versionUpgrade to version 1.123.32, 2.17.4, or 2.18.1 or later, depending on which release line you are on. Use your normal update process: npm update n8n or docker pull the new image.
- Restart n8nRestart the n8n service or container to load the fixed version. Verify that the service is running and accessible.
- Verify the fix is in placeRun npm list n8n or docker exec npm list n8n and confirm the version is 1.123.32, 2.17.4, 2.18.1 or later.
- Review OAuth clients registered before the upgradeLog in to n8n as an admin and check the list of registered OAuth clients. Delete any clients you do not recognize or that have suspicious names. If you suspect an attacker registered a malicious client, review workflows and audit logs for unauthorized changes.
- Review user sessions and credentialsIf users reported unusual activity, check audit logs for unauthorized workflow edits or credential access. Consider forcing password resets for high-privilege accounts if you found evidence of compromise.
How to confirm it is fixed: Confirm that all n8n instances are running version 1.123.32, 2.17.4, 2.18.1 or later by running npm list n8n on each instance.
SecurityElites Quick Fixes: copy and paste
Upgrade n8n with npmupgrade
npm install n8n@2.18.1
npm ls n8nCheck n8n version (npm)for this issue
npm list n8nCheck n8n version (Docker)for this issue
docker exec <container_name> 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-42235) 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.18.1 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 script injection in OAuth notification allows credential theft (CVE-2026-42235)
**Severity:** High | **SE Fix-First Score:** 43/100 | **Fix window:** Within 30 days
**Record:** SE-AIV-01719 https://securityelites.com/ai-vulnerabilities/cve-2026-42235-n8n-script-injection-in-oauth-notification-allows-credential-theft/
### Why this matters
An attacker can register a malicious OAuth client and inject code that runs in another user's browser when they revoke access. This code can steal login tokens, change workflows, or give the attacker admin rights to n8n.
### What to do
1. Find where n8n is running
2. Check the current n8n version
3. Back up configuration and workflows
4. Upgrade n8n to a fixed version
5. Restart n8n
6. Verify the fix is in place
7. Review OAuth clients registered before the upgrade
8. Review user sessions and credentials
Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-42235-n8n-script-injection-in-oauth-notification-allows-credential-theft/
### Done when
- [ ] n8n is at 2.18.1 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Confirm that all n8n instances are running version 1.123.32, 2.17.4, 2.18.1 or later by running npm list n8n on each instance.
- [ ] 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 Chat Trigger allows injected JavaScript to run as a logged-in user High · CVE-2026-54302
- n8n webhook node can run JavaScript as an authenticated user High · CVE-2026-54301
Change history
- 29 Apr 2026: Made public
- 3 Dec 2026: Published
Official record
## Impact An unauthenticated attacker could register a malicious MCP OAuth client with a crafted `client_name`. If a victim user authorized the OAuth consent dialog and a second user subsequently revoked that access, a toast notification would render the injected script. Clicking the link would execute arbitrary JavaScript in the victim's authenticated n8n browser session, enabling credential and session token theft, workflow manipulation, or privilege escalation.## Patches This issue has been fixed in n8n version 2.14.2. Users should upgrade to this version or later to remediate the vulnerability.## Workarounds If upgrading is not immediately possible, administrators should consider the following temporary mitigations: - Restrict access to the n8n instance and the MCP OAuth registration endpoint to trusted users only. - Disable MCP server functionality if it is not actively required.These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Weakness type: CWE-79, CWE-87
Use this record in your own tools
Get this record as JSON
curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-42235For 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.