NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · n8n

CVE-2026-42235: n8n Vulnerable to XSS via MCP OAuth client

highCVSS 4.0 8.8 · 3.1 8.2GHSA-537j-gqpc-p7fq

An unauthenticated attacker can register an MCP OAuth client in n8n with a crafted client_name that runs as script in the toast notification shown after another user revokes access. The script runs in the victim's logged-in session. The package data lists fixes in n8n 1.123.32, 2.17.4 and 2.18.1.

Published Apr 29, 2026 · Updated May 8, 2026 · Analysis Oct 28, 2026

What an attacker can do

n8n's MCP OAuth client registration lets anyone register a client with a name of their choice. The name was rendered unescaped in a toast notification (CWE-79). The chain has steps: the attacker registers the malicious client; a victim approves its OAuth consent dialog; later a second user revokes that access; the toast shows the injected content, and a click on the link runs the JavaScript.

The script executes in the n8n origin with the victim's session. It can steal credentials and session tokens, change workflows or escalate privileges. CVSS 3.1 rates complexity high and requires user interaction, which fits the multi-step chain.

The attacker needs no account. They do need a victim to approve the consent dialog and someone to revoke, so the risk is on instances where MCP access is in use and admins review or revoke clients.

Who is affected

The npm package n8n below 1.123.32, 2.17.x below 2.17.4, and 2.18.0, per the package data. The advisory text states the fix as 2.14.2; use the newer releases to be safe. Instances using the MCP server feature and OAuth clients are exposed.

npm ls n8n

n8n

Ecosystem
npm
Affected
< 1.123.32
Fixed in
1.123.32
Check
npm ls n8n

n8n

Ecosystem
npm
Affected
>= 2.18.0, < 2.18.1
Fixed in
2.18.1
Check
npm ls n8n

n8n

Ecosystem
npm
Affected
>= 2.17.0, < 2.17.4
Fixed in
2.17.4
Check
npm ls n8n

How to fix it

Upgrade to n8n 1.123.32, 2.17.4 or 2.18.1, or later. The advisory text names 2.14.2 as the first fix on the 2.x line, while the package data lists the newer versions for each branch.

Temporary mitigations from the advisory (not a full fix): restrict access to the n8n instance and the MCP OAuth registration endpoint to trusted users, and disable MCP server functionality if you do not need it. Review registered MCP OAuth clients and remove ones you do not recognise.

How to tell if you were hit

List registered MCP OAuth clients and look for names that contain <, >, javascript: or HTML tags. Check access logs for unauthenticated requests to the MCP OAuth registration endpoint from unfamiliar addresses. Review which clients users authorised in the consent dialog.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to OscarBataille.

Questions

Does the attacker need an n8n account?

No. An unauthenticated attacker can register the malicious client. A user must approve it and another user revoke it for the script to show.

What can the script do?

Run JavaScript in the victim's authenticated session: steal credentials and tokens, change workflows or escalate privileges.

Which version fixes it?

The advisory text says 2.14.2 or later; the package data lists 1.123.32, 2.17.4 and 2.18.1 for the branches.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More n8n vulnerabilities

All n8n entries