Content-Security-Policy: The Header That Stops Most XSS Attacks Cold
XSS keeps working because browsers trust whatever the page tells them to load. Content-Security-Policy changes that contract: an allow-list the browser enforces even after your input filtering misses one.