What are the risks associated with using inline styles?
A Content Security Policy with a default-src or style-src directive will prevent inline styles from being applied to <style> elements or style attributes. To allow the use of inline styles, a value of unsafe-inline must be applied to a CSP fetch directive. This seems to indicate that inline styles are unsafe. While inline Javascript is an obvious attack vector for XSS attacks (CSP is pretty much useless with script-src 'unsafe-inline' ), Google Web Fundamentals considers inline-styles to be a relatively equivalent threat , providing one example of a clever data exfiltration method from a 2009