Skip to content

Commit

Permalink
Update source expression values for default-src, script* and style*
Browse files Browse the repository at this point in the history
  • Loading branch information
wbamberg committed Nov 14, 2024
1 parent e6e58cd commit d9bf136
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ This directive may have one of the following values:
- : No resources may be loaded. The single quotes are mandatory.
- `<source-expression-list>`

- : A space-separated list of _source expression_ values. Resources may be loaded if they match any of the given source expressions.

Source expressions are specified as keyword values or URL patterns: the syntax for each source expression is given in [CSP Source Values](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources).
- : A space-separated list of _source expression_ values. Resources may be loaded if they match any of the given source expressions. For this directive, any of the values listed in [Source expression syntax](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#source_expression_syntax) are applicable.

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ This directive may have one of the following values:
- : No resources of this type may be loaded. The single quotes are mandatory.
- `<source-expression-list>`

- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions.
- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions. For this directive, the following source expression values are applicable:

Source expressions are specified as keyword values or URL patterns: the syntax for each source expression is given in [CSP Source Values](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources).
- [`'unsafe-hashes'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-hashes)
- [`'unsafe-inline'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-inline)
- [`'report-sample'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#report-sample)

`script-src-attr` can be used in conjunction with {{CSP("script-src")}}, and will override that directive for checks on inline handlers:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ This directive may have one of the following values:
- : No resources of this type may be loaded. The single quotes are mandatory.
- `<source-expression-list>`

- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions.

Source expressions are specified as keyword values or URL patterns: the syntax for each source expression is given in [CSP Source Values](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources).
- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions. For this directive, any of the values listed in [Source expression syntax](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#source_expression_syntax) are applicable, with the exception of [`'unsafe-hashes'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-hashes).

`script-src-elem` can be used in conjunction with {{CSP("script-src")}}:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ This directive may have one of the following values:
- : No resources of this type may be loaded. The single quotes are mandatory.
- `<source-expression-list>`

- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions.

Source expressions are specified as keyword values or URL patterns: the syntax for each source expression is given in [CSP Source Values](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources).
- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions. For this directive, any of the values listed in [Source expression syntax](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#source_expression_syntax) are applicable.

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ This directive may have one of the following values:
- : No resources of this type may be loaded. The single quotes are mandatory.
- `<source-expression-list>`

- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions.
- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions. For this directive, the following source expression values are applicable:

Source expressions are specified as keyword values or URL patterns: the syntax for each source expression is given in [CSP Source Values](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources).
- [`'unsafe-hashes'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-hashes)
- [`'unsafe-inline'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-inline)
- [`'report-sample'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#report-sample)

`style-src-attr` can be used in conjunction with {{CSP("style-src")}}:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ This directive may have one of the following values:
- : No resources of this type may be loaded. The single quotes are mandatory.
- `<source-expression-list>`

- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions.

Source expressions are specified as keyword values or URL patterns: the syntax for each source expression is given in [CSP Source Values](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources).
- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions. For this directive, the same source expression values are applicable as for [`style-src`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src), with the exception of [`'unsafe-hashes'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-hashes).

`style-src-elem` can be used in conjunction with {{CSP("style-src")}}:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@ This directive may have one of the following values:
- : No resources of this type may be loaded. The single quotes are mandatory.
- `<source-expression-list>`

- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions.

Source expressions are specified as keyword values or URL patterns: the syntax for each source expression is given in [CSP Source Values](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources).
- : A space-separated list of _source expression_ values. Resources of this type may be loaded if they match any of the given source expressions. For this directive, the following source expression values are applicable:

- [`<host-source>`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#host-source)
- [`<scheme-source>`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#scheme-source)
- [`'self'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#self)
- [`'unsafe-inline'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-inline)
- [`'unsafe-hashes'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-hashes)
- [`'nonce-NONCE_VALUE'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#nonce-nonce_value)
- [`'hash_algorithm-HASH_VALUE'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#hash_algorithm-hash_value)
- [`'report-sample'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#report-sample)

## Examples

Expand Down

0 comments on commit d9bf136

Please sign in to comment.