AgentbeamBeta
AI agent vulnerability · n8n

CVE-2025-46343: n8n Vulnerable to Stored XSS through Attachments View Endpoint

mediumCVSS 3.1 5.0GHSA-c8hm-hr8h-5xjw

n8n before 1.90.0 serves stored binary files from its attachments view endpoint with a MIME type taken from a GET parameter. A member-level user can upload HTML with script and get it to run in another user's session, which can lead to account takeover. Upgrade n8n to 1.90.0.

Published Apr 28, 2025 · Updated Apr 29, 2025 · Analysis Nov 24, 2026

What an attacker can do

n8n workflows can store binary files and serve them to authenticated users. The view endpoint did not restrict the MIME type, and a GET parameter set it. The server would answer with any type, including text/html.

The attack has two steps. A user with member permissions uploads a crafted HTML file that contains JavaScript. Then another user, who opens the binary data endpoint with the MIME type set to text/html, runs the script in the context of their own session on the n8n origin. The advisory's example is a request that changes the victim's email address in account settings, which opens the way to account takeover through password reset.

The victim has to open the link (UI:R), and the attacker needs an account. The risk is greatest on shared instances where members and administrators coexist: a member can aim at an owner or admin, and the script then acts with their rights, including access to credentials and workflows. A single-user instance has little exposure.

Who is affected

n8n on npm below 1.90.0. Multi-user instances with member-level accounts matter most. Check the version:

npm ls n8n

For Docker installs, read the image tag, or the version shown in the n8n UI under Help and About.

n8n

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

How to fix it

Upgrade n8n to 1.90.0 or later:

npm install -g [email protected]

The fix, from pull request 14685, replaces an earlier mitigation that did not always work. It adds an explicit allow-list of MIME types that may be viewed in the UI, lets the MIME type and file name stored by the server override values in the URL, lowercases the type before the check, and sets the Content-Type header only after the file passes. The advisory lists no workaround.

How to tell if you were hit

Review reverse proxy and n8n access logs for requests to the binary data view endpoint that carry a mimeType query value of text/html or another script-capable type. Compare them with the user who uploaded the file.

Check for member accounts that store HTML or SVG binary data in workflows, and look for unexpected changes to user email addresses or password resets in your n8n user list.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

n8n workflows can store and serve binary files, which are accessible to authenticated users. However, there was no restriction on the MIME type of uploaded files, and the MIME type could be controlled via a GET parameter. This allowed the server to respond with any MIME type, potentially enabling malicious content to be interpreted and executed by the browser.

An authenticated attacker with member-level permissions could exploit this by uploading a crafted HTML file containing malicious JavaScript. When another user visits the binary data endpoint with the MIME type set to text/html, the script executes in the context of the user’s session. This script could, for example, send a request to change the user’s email address in their account settings, effectively enabling account takeover.

Patches

Credit

We would like to thank @Mahmoud0x00 for reporting this issue.

Credited to Mahmoud0x00.

Questions

Which n8n version fixes CVE-2025-46343?

n8n 1.90.0. Everything below it is affected, per the advisory.

What can the script do once it runs?

It runs in the victim's session on the n8n origin. The advisory's example sends a request that changes the user's email address, which leads to account takeover.

Does the attacker need an account?

Yes, member-level permissions to upload the file, and the victim must open the crafted link. The CVSS vector sets privileges as low and user interaction as required.

Is it exploited in the wild?

No source says so. The advisory credits a researcher for the report and the entry has no KEV record.

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