How mass-assignment led to stored-XSS and a CSP bypass in a major
The chatbot platform merged client-supplied JSON into server models without an allow-list, so attackers could set HTML-bearing fields that were later rendered in customer widgets and internal consoles. A sanitisation mismatch and a permissive CSP allowed persisted HTML to execute as script in some contexts.
Short summary: In recent research I discovered a high-impact vulnerability class in a widely used chatbot vendor. The root cause was unsafe mass-assignment: the platform merged incoming JSON into server models without allow-listing fields.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the API merged arbitrary client JSON keys into persisted models without an allow-list, and the rendering pipeline's sanitisation and CSP did not reliably neutralise the stored HTML.
Impact
Persisted script could run in customer-facing widgets and privileged internal consoles, potentially affecting around 500 customer instances, though the text does not demonstrate a specific account takeover.
What the attacker needed
Ability to send JSON to the API; a field rendered as HTML; sanitiser bypass; permissive CSP
The fix
The platform should allow-list writable fields, sanitise HTML on the server, and deploy a strict CSP with per-response nonces or hashes.
How it was found
- Send JSON to the API endpoint containing extra fields such as html or markup.
- The server merges those fields into the stored model without checking them against an allow-list.
- The stored content is returned in API responses and injected into the chat widget DOM and internal consoles.
- Encode or vary the event-handler syntax so the naive sanitiser misses it.
- The permissive CSP fails to block the resulting script execution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Mass assignment is when a program takes a whole bundle of data from a user and copies every field into its internal record, instead of accepting only the fields it expects. Here that let an attacker sneak in a field meant to hold web page markup, which the site later displayed without fully cleaning it. The result was stored cross-site scripting: malicious markup saved on the server and shown to other people, including support staff.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.