n8n: Webhook Responses Without the Sandbox Policy Allow Stored Cross-Site Scripting
What fixes it
No source in this snapshot names a fixed version.
Description
Impact
n8n adds a sandbox Content-Security-Policy to webhook responses so that HTML from a workflow cannot run on the n8n origin. Some response paths, such as error responses and some responses without headers, did not add this policy. A member who can create and activate workflows can serve HTML that runs as a page on the n8n origin. When another user opens the webhook URL, the script can act with that user's session.
Patches
The issue has been fixed in n8n versions 1.123.85, 2.44.1, and 2.43.5. 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:
- Restrict n8n instance access to fully trusted users only.
- Audit active webhook workflows and review the response bodies returned by nodes operating in legacy response mode for unexpected HTML or script content.
- Apply network-level controls to restrict access to
/webhook/*routes to trusted sources only.
These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Text from GitHub Advisory Database
Affected versions 3
- n8n, npm< 1.123.85GitHub
- n8n, npm< 2.44.1GitHub
- n8n, npm< 2.43.5GitHub