w3c / resource-timing

Resource Timing
https://w3c.github.io/resource-timing/
Other
119 stars 35 forks source link

Capturing basic auth credentials in URLs, part 2 #368

Open nicjansma opened 1 year ago

nicjansma commented 1 year ago

I'd like to re-open for discussion this issue we discussed in ~2015: https://github.com/w3c/resource-timing/issues/7

In it, we decided that ResourceTiming entries that contain HTTP Basic Auth in the URL (e.g. https://username:password@domain.com) should be kept in the .name (URL) field.

While I think we all agree that this is not best-practice to hard-code credentials into URLs, in the real world we are still seeing this happen in a few scenarios across the web:

In the DOM/JavaScript, URLs that contain credentials may be read by scripts in a few ways.

Let's say you navigate via a <a href="https://username:password@domain.com">click</a> link:

From a compat POV, Chrome and Firefox report the credentials in ResourceTiming, but Safari does not.

Unfortunately this makes it relatively easily to unintentionally capture and potentially exfiltrate credentials, either by the sites themselves, or for a third-party RUM provider.

We discussed this on the 2023/01/19 W3C WebPerf call: https://docs.google.com/document/d/1PNqm7eHbtHjb8d4VQNiti3wuPk3WKLzRs7tUCXXISrA/edit#

My summary of that discussion:

yoavweiss commented 4 months ago

@clelland - Any progress on the spec work here? Are there open implementation bugs? WPTs?