XSS in Ably Chat: A Real-World Before-and-After Fix

Chat feels harmless until someone sends "<img src=x onerror=alert(1)>" and your UI happily executes it. I’ve seen this exact pattern in real-time apps: the backend is fine, Ably is delivering messages exactly as designed, and the browser becomes the weak point because the frontend treats chat content like trusted HTML. That’s the whole bug. This case study walks through a typical Ably chat setup, the vulnerable version I keep seeing in production, and the cleaned-up version that blocks XSS without making the chat experience miserable. ...

August 19, 2026 · 6 min · headertest.com