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
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026