{"type":"rich","version":"1.0","provider_name":"Transistor","provider_url":"https://transistor.fm","author_name":"Cybersecurity Tech Brief By HackerNoon","title":"Controlling Scripts With Content Security Policy: Hashes, Nonces, and strict-dynamic","html":"<iframe width=\"100%\" height=\"180\" frameborder=\"no\" scrolling=\"no\" seamless src=\"https://share.transistor.fm/e/ab8be064\"></iframe>","width":"100%","height":180,"duration":793,"description":"\n        This story was originally published on HackerNoon at: https://hackernoon.com/controlling-scripts-with-content-security-policy-hashes-nonces-and-strict-dynamic.\nLearn how CSP script-src controls what scripts can be executed with allowlists, hashes, nonces, strict-dynamic, script-src-elem and script-src-attr.\nCheck more stories related to cybersecurity at: https://hackernoon.com/c/cybersecurity.\n            You can also check exclusive content about #content-security-policy, #csp, #web-security, #browser-security, #xss, #javascript-security, #xss-prevention, #hackernoon-top-story,  and more.\nThis story was written by: @darevskaya. Learn more about this writer by checking @darevskaya's about page,\n            and for more stories, please visit hackernoon.com.\nContent Security Policy’s script-src directive controls which scripts a page can run, but how you use it depends on the case. Origin allowlists are simple, but they trust every script from an allowed domain. Hashes work well for static inline scripts. Nonces are better for dynamic HTML generated per response. strict-dynamic helps when a trusted script needs to load other scripts. For legacy inline event handlers, script-src-elem and script-src-attr can make CSP adoption more gradual.\n        \n        ","thumbnail_url":"https://img.transistorcdn.com/SySK4I0jwuU6AzeawZdYiDqTq8yzBjxJ5qfTpUuAxEo/rs:fill:0:0:1/w:400/h:400/q:60/mb:500000/aHR0cHM6Ly9pbWct/dXBsb2FkLXByb2R1/Y3Rpb24udHJhbnNp/c3Rvci5mbS9zaG93/LzQxMjY2LzE2ODM1/ODIzNTYtYXJ0d29y/ay5qcGc.webp","thumbnail_width":300,"thumbnail_height":300}