Treat data: URLs as potentially trustworthy
According to [1], URLs whose scheme is "data" should be treated as potentially trustworthy. This CL performs the change to align with the specification and remove unnecessary special handling in various places of the code. This CL does not contain significant behavioral changes, and has no web-facing API changes. However, an intent email has been sent [2] and a chromestatus page created [3]. Owners of the files from which network::IsUrlPotentiallyTrustworthy is called were informed and indicated the change is fine: - NetworkFetcherImpl::DownloadToFile: Not exposed to the web at all. Used by an automated software updater which checks with a hardcoded Google endpoint for updates to certain Chrome modules. - IdpNetworkRequestManager::Create: This code has been implemented recently and is not released yet. - content_security_policy.cc's UpgradeInsecureRequest: already exits early for non-HTTP schemes. - security state's GetSecurityLevel: already exits early for data scheme. - password_manager_ios_util.mm: data URLs are not supported on other platforms so it should be excluded on iOS too. This is already the case since only localhost hosts, file: and cryptographic schemes returns true. - CookieChangeSubscription, CookieAccessDelegateImpl: should be fine because code excludes data schemes (on non-iOS platforms) as well as opaque origins (like data:). Moreover, data: doesn't go over http. - InsecureInputTabHelper: used to include data schemes in the past [4], uploaded [5] to preserve current behavior. - sec_header_helpers.cc: Only matters for HTTP requests. - TouchToFillController: Removed in [6]. - RemoteCopyMessageHandler::HandleImage: This is guarded by IsImageSourceAllowed. kRemoteCopyAllowedOrigins, defaults to "https://googleusercontent.com" and having a real use case where someone adds a "data:" host seems unlikely. [1] https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url [2] https://groups.google.com/u/1/a/chromium.org/g/blink-dev/c/Hb1-VLwq54Y [3] https://chromestatus.com/feature/5634194258526208 [4] https://chromium-review.googlesource.com/c/chromium/src/+/1986072 [5] https://chromium-review.googlesource.com/c/chromium/src/+/2580067 [6] https://chromium-review.googlesource.com/c/chromium/src/+/2574743 Bug: 1119740, 1153336 Change-Id: I4db1b71ab0dc4d7a0635e8524a3757dc4388edf9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2563683Reviewed-by:Christoph Schwering <schwering@google.com> Reviewed-by:
Mike West <mkwst@chromium.org> Reviewed-by:
Matt Falkenhagen <falken@chromium.org> Commit-Queue: Frédéric Wang <fwang@igalia.com> Cr-Commit-Position: refs/heads/master@{#836025}
Showing
Please register or sign in to comment