如何将nonce或sha添加到表格的内容安全策略中
我正在尝试实施CSP,到目前为止,直到我可以跨越具有大型形式的页面。
我已经在“脚本src”中添加了一个“ nonce”,但是当生成表单时,它添加了一个自动标签,我不知道如何添加安全或如何为其生成SHA值。
对于先前的SHA值,它已在控制台面板中列出,因此我添加了它们,但是对于这些自动化的值,它只是在下面丢弃了错误,而没有其他内容可以缩小范围:
拒绝执行内联脚本,因为它违反了以下内容Content Security Policy directive: "script-src https: nonce-123 'sha256-123=' 'unsafe-inline' 'unsafe-eval'".请注意,如果源列表中存在哈希值或nonce值。
我检查了此线程将nonce属性添加到自动生成的webforms脚本,但我不明白他如何生成SHA值以添加到CSP中?
如何计算或添加nonce的表单自动脚本?
I am attempting to implement a CSP and so far it was ok until i can across a page with a large form.
I have added a 'nonce' to 'script src' but when the form is generated it adds an automated tag that i dont know either how to add as safe or how to generate the sha value for it.
For previous sha values it was listed in the console panel so i added them but for these automated ones it just throws the error below and nothing else to narrow it down:
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src https: nonce-123 'sha256-123=' 'unsafe-inline' 'unsafe-eval'". Note that 'unsafe-inline' is ignored if either a hash or nonce value is present in the source list.
I checked this thread Add nonce attribute to auto-generated WebForms script but i dont understand how he generated the sha value to add to the CSP?
How could i calculate or add a nonce to this automated script for a form?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论