You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
If ngSanitize is added as a module dependency and a Content-Security-Policy is set that does not allow inline styles then Firefox shows the following message:
Content Security Policy: The page’s settings observed the loading of a resource at self (“default-src”). A CSP report is being sent.
If ngSanitize is removed from the module dependencies then the CSP message disappears as well.
Expected / new behavior:
ngSanitize should work in Firefox without triggering CSP alerts, at least if the "ng-csp" mode is enabled.
Minimal reproduction of the problem with instructions:
Set the Content-Security-Policy to: default-src: 'self'
Add 'ngSanitize' as a module dependency.
AngularJS version: 1.6.9
Browser: Firefox 60.0a1 and 59.0b10
Anything else:
I guess the following code triggers the CSP alert, since it adds an inline <style> tag. // Check for the Firefox bug - which prevents the inner img JS from being sanitized inertBodyElement.innerHTML = '<svg><p><style><img src="</style><img src=x onerror=alert(1)//">';
From: https://github.com/angular/angular.js/blob/master/src/ngSanitize/sanitize.js
Line 443-444