DEV Community

Discussion on: Missed Frontend Vulnerabilities (1): CSS is not as safe as you think!

Collapse
 
xcs profile image
XCS

CSP is useful, but I don't think it is for this case as the initial resource and hack are loaded from the same domain.

Wouldn't it be more useful to add an integrity check to make sure the file is not updated? Do link nodes support the integrity attribute?

Collapse
 
eldrimm profile image
Wesley van Drimmelen • Edited

Using strict CSP you can block the background-image requests, which would be the malicious domain/api of the attacker. Using strict csp directives you can block these requests, that's how we're doing it at my current job