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

imgSrcSanitizationWhitelist seems too broad #8274

Closed
sirdarckcat opened this issue Jul 21, 2014 · 3 comments
Closed

imgSrcSanitizationWhitelist seems too broad #8274

sirdarckcat opened this issue Jul 21, 2014 · 3 comments

Comments

@sirdarckcat
Copy link

in
https://github.com/angular/angular.js/blob/master/src/ng/sanitizeUri.js

imgSrcSanitizationWhitelist = /^\s*(https?|ftp|file|blob):|data:image\//;

probably should be:

imgSrcSanitizationWhitelist = /^\s*(https?|ftp|file|blob):|^\s*data:image\//;

otherwise:

javascript:alert(1)//data:image/

passes as valid.

@jeffbcross jeffbcross self-assigned this Jul 21, 2014
@btford btford assigned btford and unassigned jeffbcross Jul 21, 2014
@btford btford added this to the 1.3.0-beta.17 milestone Jul 21, 2014
@petebacondarwin
Copy link
Contributor

Or perhaps:

/^\s*((https?|ftp|file|blob):|data:image\/)/

@petebacondarwin
Copy link
Contributor

@btford - do you have any comment on this? I could take this and knock up a PR if there is not something more complex to worry about here.

@btford btford modified the milestones: 1.3.0-beta.18, 1.3.0-beta.19 Aug 11, 2014
@sirdarckcat
Copy link
Author

oh, also, it would be nice to add chrome-extension: and chrome-extension-resource: to the list of schemes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants