Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat(security): explicitly whitelist URL schemes for bootstrap. #15427

Merged
merged 1 commit into from
Nov 23, 2016

Conversation

mprobst
Copy link
Contributor

@mprobst mprobst commented Nov 23, 2016

Many browsers have some extension URL scheme. It is unclear how many of
those have the security issue of allowing parser-inserted loads of
extension URLs.

To be conservative, this code whitelists the URL schemes that are known
to be subject to CSP, i.e. the ones that are expected and safe.

Note: there is no change in tests as behavior does not change for any known URL.

@mprobst
Copy link
Contributor Author

mprobst commented Nov 23, 2016

@Rob--W thanks for the suggestion by the way, whitelisting is indeed much better.

@rjamet, @koto FYI.

This change is motivated by the discussion in mozilla/addons-linter#1000.

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

case 'data:':
return true;
default:
false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean return false?

Copy link
Contributor Author

@mprobst mprobst Nov 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-(

I've gotten used to TypeScript too much. Fixed.

Many browsers have some extension URL scheme. It is unclear how many of
those have the security issue of allowing parser-inserted loads of
extension URLs.

To be conservative, this code whitelists the URL schemes that are known
to be subject to CSP, i.e. the ones that are expected and safe.
@mprobst mprobst merged commit 7f1b8bd into angular:master Nov 23, 2016
@mprobst mprobst deleted the whiteslist-schemes branch November 23, 2016 23:44
petebacondarwin pushed a commit that referenced this pull request Nov 24, 2016
Many browsers have some extension URL scheme. It is unclear how many of
those have the security issue of allowing parser-inserted loads of
extension URLs.

To be conservative, this code whitelists the URL schemes that are known
to be subject to CSP, i.e. the ones that are expected and safe.
ellimist pushed a commit to ellimist/angular.js that referenced this pull request Mar 15, 2017
…lar#15427)

Many browsers have some extension URL scheme. It is unclear how many of
those have the security issue of allowing parser-inserted loads of
extension URLs.

To be conservative, this code whitelists the URL schemes that are known
to be subject to CSP, i.e. the ones that are expected and safe.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants