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
The CSP (Content Security Policy) can be used on any document to limit the document's scripting ability. caniuse says Chrome and Firefox support this feature already.
The supports tests do things like creating <object src="data:…"> to determine if they're focusable or not and these tests may violate a CSP.
This problem was first spotted by @ryan-ludwig with Chrome Apps, which sport the following (not relaxable) CSP:
"Refused to load plugin data from 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zd…V4dCB4PSIxMCIgeT0iMjAiIGlkPSJzdmctbGluay10ZXh0Ij50ZXh0PC90ZXh0Pjwvc3ZnPg==' because it violates the following Content Security Policy directive: "default-src 'self' blob: filesystem: chrome-extension-resource:". Note that 'object-src' was not explicitly set, so 'default-src' is used as a fallback."
The problem in this particular case is that the directive object-src 'self' data:; is missing. See the potential CSP violations below.
CSP directives currently required by ally.js 1.1.0
@rodneyrehm I've also ran into some issue with CSP, mainly due to the focus-object-svg.js test. This causes issues with with Content Security Policy directive: "object-src 'none'".
I am curious, is there a specific reason for using an 'object' tag instead of an 'img' tag in those tests?
The CSP (Content Security Policy) can be used on any document to limit the document's scripting ability. caniuse says Chrome and Firefox support this feature already.
The supports tests do things like creating
<object src="data:…">
to determine if they're focusable or not and these tests may violate a CSP.This problem was first spotted by @ryan-ludwig with Chrome Apps, which sport the following (not relaxable) CSP:
The error they observed was:
The problem in this particular case is that the directive
object-src 'self' data:;
is missing. See the potential CSP violations below.CSP directives currently required by ally.js 1.1.0
After running the test suite with
Content-Security-Policy-Report-Only
the following violations were logged, forming this policy:style-src: inline
covered by directive
style-src 'unsafe-inline';
img-src: data
covered by directive
img-src data:;
media-src: data
covered by directive
media-src data:;
object-src: data
covered by directive
object-src 'self' data:;
above CSP violation reports don't make any sense to me. The reasons are probably:
frame-src: data
covered by directive
frame-src data:;
above CSP violation reports don't make any sense to me. The reasons are probably:
We're not the first to face this issue. Angular introduced ng-csp to work around this in lieu of a proper CSP feature detection.
I don't yet know how CSP compliance should be handled by libraries such as ally.js. I'm open to suggestions.
The text was updated successfully, but these errors were encountered: