Hacker News new | ask | show | jobs
by wuyishan 3047 days ago
Couldn't Content Security Policy (CSP) [1] be used to mitigate this attack?

[1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP

1 comments

It actually can't. Instagram does use this protect java-script injection from extensions, but clearly injecting CSS is allowed.
But could you use CSP to block the image loading that happens in the CSS with 'img-src' definitions?

Someone else in this thread suggested that as well.

The requested resource, however, could be blocked by a CSP.