0
我已经在我的应用程序上实施了内容安全策略,并且现在只在报告模式下进行测试。适当地调整策略后,我已经留下了相当多的报道称,像这样:违反内容安全政策
{
"csp-report": {
"blocked-uri": "self",
"document-uri": "https://example.com/path/to/app/page.php",
"original-policy": "script-src 'nonce-DrZQpFyD2k9sGWT5' https://example.com https://ajax.googleapis.com https://maps.googleapis.com; default-src https://example.com; style-src https://example.com 'unsafe-inline' https://maxcdn.bootstrapcdn.com; img-src * data:; font-src https://example.com https://maxcdn.bootstrapcdn.com; frame-src https://example.com; frame-ancestors https://example.com; form-action *; report-uri https://<>.report-uri.io/r/default/csp/reportOnly",
"script-sample": "onmouseout attribute on DIV element",
"source-file": "https://example.com/path/to/app/page.php?id=143",
"violated-directive": "script-src 'nonce-DrZQpFyD/k9sGWT5' https://example.com https://ajax.googleapis.com https://maps.googleapis.com https://code.jquery.com/ "
}
}
大多数应用程序使用Chrome的用户,但这些报道完全来自Firefox浏览器。有时脚本示例说onmouseover
或其他鼠标事件。我浏览了应用程序中的所有代码,并且没有使用属性鼠标事件的任何地方。
任何想法是什么造成这种情况?
任何使用鼠标事件的外部代码,如Google Analytics(分析)? – cdhowie
@cdhowie触发报告触发页面上唯一外部包含的代码是jQuery UI,但我没有看到Edge,IE或Chrome的违规行为。 –