Special handling of localhost.localdomain host
- Category
- Network / Connectivity
- Type
- Feature removal
- Status
- In development (Chrome In development)
- Intent stage
- Start incubating
WPT details: Not tested yet. We could add entries for localhost.domain in https://web-platform-tests.org/running-tests/from-local-system.html#hosts-file-setup and then test whether the browser override DNS and or treat origins as "potentially trustworthy".
Summary
Currently, host name "localhost.localdomain" resolves to the loopback addresses ::1 and 127.0.0.1, bypassing native DNS, and the corresponding origin is treated as secured. The goal of this entry is to remove this non-standard behavior.
Motivation
Standards describe an optional resolution of the "localhost" host name and trustworthiness of corresponding origin [1] [2]. Users have complained about inconsistency between Chromium (which implements the spec), Firefox (which only implemented it recently) and WebKit (where patches are being submitted). Hopefully things can be make consistent and the specification a bit stricter. However, Chromium also has similar but non-standard behavior for "localhost.localdomain". Removing this would help to make things more predictable for users.
Standards & signals
- Specification: https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy
- Firefox: No signal — Firefox implemented the specification for "localhost" but not the non-standard value "localhost.localdomain" which was never discussed.
- Safari: No signal — There is not an official position, some Apple people have expressed interest for implementing this "localhost" resolution (currently native DNS on macOS/iOS don't do that), others had concerns about allowing websites to access localhost addresses and so make them trustworthy. Introducing "localhost.localdomain" would only make harder to reach a consensus, while Chrome making a step towards the spec / other browsers could be appreciated.
- Web developers: Positive — Developers were positive about making Firefox/WebKit more interoperable with Chrome (see corresponding bug reports).
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1153337
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=special-handling-of-localhost-localdomain-host
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Special%20handling%20of%20localhost.localdomain%20host
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Special%20handling%20of%20localhost.localdomain%20host
- Baseline status: https://webstatus.dev/?q=Special%20handling%20of%20localhost.localdomain%20host
Docs: https://tools.ietf.org/html/draft-west-let-localhost-be-localhost-06 https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy