CSP: style-src unsafe-hashes

  • 警报等级:
  • Medium

  • 警报类型:
  • Passive
摘要

Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks. Including (but not limited to) Cross Site Scripting (XSS), and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware. CSP provides a set of standard HTTP headers that allow website owners to declare approved sources of content that browsers should be allowed to load on that page — covered types are JavaScript, CSS, HTML frames, fonts, images and embeddable objects such as Java applets, ActiveX, audio and video files.

解决方案

Ensure that your web server, application server, load balancer, etc. is properly configured to set the Content-Security-Policy header.

其他信息
style-src includes unsafe-hashes, an attacker will be able to use any of the code covered by such hashes.
参考

https://www.w3.org/TR/CSP3/#unsafe-hashes-usage

https://content-security-policy.com/examples/allow-inline-style/