feat(security): allow data: URLs for images and videos.#8661
feat(security): allow data: URLs for images and videos.#8661mprobst merged 1 commit intoangular:masterfrom
Conversation
|
LGTM. Maybe more tests for bad data: types, data:,something, other encodings ? |
|
Good point, done. |
Allows known-to-be-safe media types in data URIs. Part of angular#8511.
|
Could we also add data:text/plain into the whitelist? |
|
@agpreynolds what's the use case? I can't quite find a CSS property where plain text would be useful? If you want plain text as a background image, I think you'll need to use SVG or a style rule with a |
|
@mprobst The use case is as a link, such as for allowing users to download a file as a .txt e.g.
I had observed the same behaviour of the url being prepended with 'unsafe:' in RC1. Is it that this is a separate issue to the one you are fixing here? |
|
@agpreynolds I'll defer to @koto and @rjamet, but it seems reasonable to me to require blessing a download with |
|
It's probably safeish, but there are some reasons to be unsure:
Since it's a really edge case, I'd keep it blacklisted, but mostly out of paranoia. |
|
data: uris are only supported since IE 8, and not for documents too, so text/plain upgrade to text/html wouldn't matter here. Second point still stands. Data: uris are same origin (though some browsers break the spec - actually almost all of them break the spec) and they support scripting. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Allows known-to-be-safe media types in data URIs.
Part of #8511.