n8n Chat Trigger Stored XSS via customCss Parameter on Hosted-Chat Page
What fixes it
No source in this snapshot names a fixed version.
Description
Impact
The Chat Trigger lets a workflow author supply custom CSS for the hosted chat page. The value was insufficiently sanitised and interpolated into the page as markup. Where the chat is published without n8n user authentication, the page is served on the instance's own origin, so the author's content executes there for any visitor. A visitor already signed in to the instance has their session acted upon. Chats published with n8n user authentication are not affected.
Patches
The issue has been fixed in n8n versions 1.123.83, 2.42.1 and 2.41.4. 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 Chat Trigger workflows and review the
customCssparameter for unexpected values. - Enable authentication on Chat Trigger nodes to prevent anonymous visitors from reaching the hosted-chat page.
- Deactivate Chat Trigger workflows that are not currently required until the instance is patched.
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.83GitHub
- n8n, npm< 2.42.1GitHub
- n8n, npm< 2.41.4GitHub