-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incomplete support for CSP #2663
Labels
Comments
Thank you for doing all this research @edukisto! I think that Prism should support all keywords and directives that it into a WD or RC of CSP. We can't assume that people only use Prism to highlight the latest version of CSP, so we do have to support some older versions as well. To answer your questions:
|
OK. I forgot to mention
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Information
Does the problem still occur in the latest version of Prism?
Yes.
Description
New directives and keywords
From the latest (2018-10-15) working draft of CSP3:
navigate-to
;prefetch-src
;script-src-attr
;script-src-elem
;style-src-attr
;style-src-elem
;'report-sample'
;'unsafe-allow-redirects'
;'unsafe-hashes'
.From Trusted Types:
require-trusted-types-for
;trusted-types
;'allow-duplicates'
;'script'
.These are partially implemented in Blink (Chromium, Chrome, etc.) and Gecko (Firefox).
Also, Google Cobalt recognizes the
suborigin
directive.By the way, there is a bunch of relevant (
input-protection
) and dropped (input-protection-clip
,input-protection-selectors
) directives from User Interface Security and the Visibility API, but I don’t know of any software that uses these directives.Old directives and keywords
Prism supports some directives and keywords, which are dropped from CSP (see the table below).
disown-opener
referrer
reflected-xss
'unsafe-hashed-attributes'
Gecko still recognizes
reflected-xss
as a directive, albeit ignored.Here are some directives and keywords, which are also dropped from CSP and have no support in Prism (see the table below).
policy-uri
'unsafe-hash-attributes'
Blink recognizes
policy-uri
as a “removed from the specification” directive. Shouldpolicy-uri
and'unsafe-hash-attributes'
be added for consistency?Code snippet
The code being highlighted incorrectly.
(script-src-attr
,script-src-elem
,style-src-attr
,style-src-elem
are partly highlighted due to #2661.)Questions
suborigin
?input-protection
?input-protection-clip
andinput-protection-selectors
?disown-opener
,referrer
,reflected-xss
,'unsafe-hashed-attributes'
)?policy-uri
and'unsafe-hash-attributes'
)?The text was updated successfully, but these errors were encountered: