New issue
Advanced search Search tips

Issue 602717 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Nov 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: ----
Type: Feature



Sign in to add a comment

Security: CSP expression matching algorithm should not match non-network schemes by default

Reported by shek...@gmail.com, Apr 12 2016

Issue description

Sorry for using this template, but the rest are irrelevant. 

As discussed in https://github.com/w3c/webappsec-csp/issues/69, we'd like to to change source expression matching logic to not match any schemes other than network schemes if source expression is "*". The caveat is that "ws"/"wss" schemes are not considered a network scheme.

On the other hand, CSP checks are performed in Fetch (https://fetch.spec.whatwg.org/#concept-websocket-establish), and by that time WebSocket request URLs are converted to "http"/"https" anyway.

Reasonable solution to conform to the new logic would be to deprecate WebSocket schemes at all, e.g. match "wss" if "https" is whitelisted, match "ws" if "http" is whitelisted, and ignore explicit "ws"/"wss" schemes in source expression, which will make matching a little less strict.

Unfortunately, there is a subset of corner-cases that is not backwards compatible:
`connect-src wss:` will not have any effect with the new logic, while it has a distinct meaning in CSP 2. We suspect that this pattern is very rare, if non-existent, in the wild. This chromium issue is opened to track the changes needed to collect metrics to see how often such policies are present.


VULNERABILITY DETAILS
Currently, non-local and non-network schemes are allowed by source expression "*".

VERSION
N/A

REPRODUCTION CASE
N/A
 

Comment 1 by tsepez@chromium.org, Apr 12 2016

Labels: -Type-Bug-Security -Restrict-View-SecurityTeam Type-Feature
Let's track this as a feature request, since it isn't a security bug per-se.

Comment 2 by shek...@gmail.com, Apr 12 2016

Thanks! Couldn't find "Feature request" as an option for an external reporter. 

cc mkswt
Labels: M-51
Status: Untriaged (was: Unconfirmed)
Components: Blink>SecurityFeature

Sign in to add a comment