Cyber Risks · PortSwigger Research

CSS injection (reflected)

Summary: CSS injection vulnerabilities arise when an application imports a style sheet from a user-supplied URL or embeds user input in CSS blocks without adequate escaping, and they are closely related to cross-site scripting but often trickier to exploit. PortSwigger notes that injecting arbitrary CSS into the victim's browser may enable various attacks, and recommends escaping user input before embedding it in CSS blocks and considering a whitelist to prevent loading of arbitrary style sheets.

Bottom line: The fix is escaping and a whitelist on style sheet URLs, yet the vulnerability class is rated Medium and is easy to overlook because it is filed as a styling issue rather than an XSS one - arbitrary CSS in a victim's browser is still attacker-controlled code running in your page.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related