-------------------
It is often necessary to evaluate whether a URL is secure in order to only enable certain features when minimum standards of authentication and confidentiality are met. For that purpose, web standards rely on the definition of "potentially trustworthy URL", which includes URLs with the "data" scheme in the latest version of the Secure Contexts specification. Blink already treats data: URLs as potentially trustworthy in some cases. The goal is to generalize this to all cases.
This is relaxing security check, so should not break existing websites. Browsers have generally handle "data:" URLs inconsistently and don't necessarily follow the latest Secure context specification. Previous version said data: URLs are not potentially trustworthy, this was only changed early this year, so there is a risk this change is going to make interoperability worse, albeit aligned with the spec.
In some cases, "data:" should not be treated as secured context, see for example the definition of "potentially trustworthy origin" in https://www.w3.org/TR/powerful-features/#is-origin-trustworthy which does not include "data:". https://chromium-review.googlesource.com/c/chromium/src/+/2563683 only modifies the definition of "potentially trustworthy url", but it's possible legacy use of the helper function actually meant to exclude "data:". For detailed discussion on the spec side, see https://github.com/w3c/webappsec-secure-contexts/issues/69
-- Frédéric Wang
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/80bbb55d-7011-d7cf-2c6f-f584af0507b4%40igalia.com.
-- Frédéric Wang
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/47469f89-74ad-ca67-215b-b1e98a78ce15%40igalia.com.
This is the right thing to do from both a spec and implementation perspective. Thanks for tackling the problem.
That said, it's not clear to me what the state of this change is in browsers today. My understanding was that this is more of a bug fix, insofar as we incorrectly consider `data:` to be inherently untrustworthy outside of Blink, but look at the ancestor chain to determine secure-contextness on the Blink side. So `isSecureContext` would be `true` in a `data:` frame within an HTTPS site today, and IDL attributes/methods/interfaces gated on `[SecureContext]` would be instantiated.
That doesn't seem to be Blink's behavior today, however, nor does https://chromium-review.googlesource.com/c/chromium/src/+/2563683 include any changes to web platform tests, so I think I'm missing something about what you actually want to change? What's going to be different for web developers after this intent?
For the record, we have many definitions of secured context ( see
https://bugs.chromium.org/p/chromium/issues/detail?id=1153336
), this intent is only about changing network::IsURLPotentiallyTrustworthy()
so that it aligns with the spec regarding data: URLs. It's still
possible that other places behave differently though.
-- Frédéric Wang