CVE-2025-46343 Overview
CVE-2025-46343 is a stored cross-site scripting (XSS) vulnerability affecting n8n, an open-source workflow automation platform. Prior to version 1.90.0, n8n allows authenticated users to upload and serve binary files through the attachments view endpoint without proper MIME type restrictions. An attacker can manipulate the MIME type via a GET parameter, enabling malicious HTML content containing JavaScript to be executed in the context of another user's browser session.
Critical Impact
This stored XSS vulnerability enables authenticated attackers with member-level permissions to execute arbitrary JavaScript in victims' browsers, potentially leading to account takeover through unauthorized email address changes.
Affected Products
- n8n versions prior to 1.90.0
- n8n workflow automation platform for Node.js
- Self-hosted n8n installations without the security patch
Discovery Timeline
- April 29, 2025 - CVE-2025-46343 published to NVD
- May 9, 2025 - Last updated in NVD database
Technical Details for CVE-2025-46343
Vulnerability Analysis
This stored XSS vulnerability exists in n8n's binary file handling mechanism. The platform allows workflows to store and serve binary files accessible to authenticated users. The core issue stems from the absence of MIME type restrictions on uploaded files combined with a controllable MIME type parameter in the binary data endpoint.
When a user uploads a file, the server does not validate or restrict the file's MIME type. Furthermore, the endpoint that serves these binary files accepts a GET parameter that specifies the MIME type to use in the HTTP response. This architectural flaw allows an attacker to upload a crafted HTML file containing malicious JavaScript and then direct victims to access the file with text/html specified as the MIME type.
The vulnerability requires user interaction, as victims must be lured to visit the malicious endpoint. However, since the attack executes within the authenticated user's session context, the malicious script has full access to perform actions on behalf of the victim.
Root Cause
The root cause of CVE-2025-46343 is improper input validation and lack of output encoding in the binary file serving mechanism. Specifically:
- Missing MIME type validation: The application does not restrict or sanitize the types of files that can be uploaded
- User-controllable Content-Type header: The GET parameter allows attackers to override the Content-Type response header, bypassing browser content sniffing protections
- Insufficient output encoding: HTML content is served without proper sanitization when rendered with text/html MIME type
Attack Vector
The attack follows a multi-step exploitation chain:
- An authenticated attacker with member-level permissions uploads a crafted HTML file containing malicious JavaScript to an n8n workflow
- The attacker constructs a URL to the binary data endpoint with the MIME type parameter set to text/html
- The attacker social engineers another authenticated user into clicking the malicious link
- When the victim visits the URL, the server responds with the HTML file using the text/html Content-Type
- The victim's browser interprets and executes the embedded JavaScript in the context of the n8n application
- The malicious script can then perform actions such as changing the victim's email address in account settings, enabling account takeover
The attack scenario demonstrates how stored XSS can be leveraged for privilege escalation and account compromise within collaborative workflow automation environments.
Detection Methods for CVE-2025-46343
Indicators of Compromise
- Unusual file uploads containing HTML or JavaScript content within n8n workflows
- HTTP requests to binary data endpoints with suspicious MIME type parameters such as text/html
- Unexpected account setting changes, particularly email address modifications
- User sessions accessing binary endpoints with mismatched Content-Type headers
Detection Strategies
- Monitor web server logs for requests to binary data endpoints containing MIME type manipulation in query parameters
- Implement Content Security Policy (CSP) headers to detect and block inline script execution
- Review workflow binary file contents for HTML tags and JavaScript code patterns
- Audit user account changes for unauthorized email address modifications
Monitoring Recommendations
- Enable detailed logging for all binary file upload and download operations in n8n
- Configure alerts for Content-Type header manipulation attempts in application traffic
- Deploy web application firewall (WAF) rules to detect XSS payloads in uploaded files
- Monitor for anomalous user session behavior following binary file access
How to Mitigate CVE-2025-46343
Immediate Actions Required
- Upgrade n8n to version 1.90.0 or later immediately
- Review existing workflows for potentially malicious binary file uploads
- Audit user account settings for unauthorized changes
- Implement network-level controls to restrict access to n8n instances pending patching
Patch Information
The vulnerability has been addressed in n8n version 1.90.0. The fix was implemented through Pull Request #14350 and Pull Request #14685. Organizations should upgrade to the patched version as the primary remediation measure. Detailed information about the security fix is available in the GitHub Security Advisory GHSA-c8hm-hr8h-5xjw.
Workarounds
- Restrict n8n access to trusted users only until patching can be completed
- Implement Content Security Policy headers with strict script-src directives at the reverse proxy level
- Configure web application firewall rules to block requests with text/html MIME type parameters to binary endpoints
- Consider temporarily disabling binary file upload functionality if operationally feasible
# Example: Add CSP headers in nginx reverse proxy configuration
# Add to your nginx server block for n8n
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none';" always;
add_header X-Content-Type-Options "nosniff" always;
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

