[LNA] http://*.local and targetAddressSpace: "local" requests from HTTPS pages are blocked as mixed active content, with no LNA prompt
Categories
(Core :: DOM: Networking, defect, P2)
Tracking
()
People
(Reporter: niklas.hansen, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:158.0) Gecko/20100101 Firefox/158.0
Steps to reproduce
- On machine A on the LAN, run an HTTP server with CORS enabled and advertise it over mDNS.
- On machine B use Firefox 158.0 (macOS) with default prefs (
network.lna.enabled = true,network.lna.blocking = true) and open any page on a public HTTPS origin. - In the console, run:
fetch("http://lna-test.local:5990")
fetch("http://lna-test.local:5990/", { targetAddressSpace: "local" })
(Or whatever port / host you hosts your HTTP server on)
Actual results
Both requests are blocked before any LNA prompt is shown:
Blocked loading mixed active content "http://lna-test.local:5990/"
Polling via XMLHttpRequest and new WebSocket("ws://lna-test.local:5990/") behave the same way.
An https:// request to the same host does get past mixed content checking and is detected by LNA, but no prompt is shown:
Local Network Access detected: top-level site "https://…", initiator "https://…", accessing target "https://lna-test.local:5990/…" via fetch. Secure context: True, prompt action: (null)
Setting security.mixed_content.block_active_content = false makes the http:// requests succeed. That suggests mixed content blocking is the only thing stopping them.
Expected results
Per MDN's Local network access page:
"Some addresses, such as private IP literals (for example, 192.168.0.1) and .local addresses (such as http://router.local), have mixed content checks relaxed in cases where local network access permissions are granted."
targetAddressSpace: "local" is documented the same way.
Firefox should show the LNA permission prompt and, once it's granted, allow these requests. That's what Chrome does: Chrome 142+ prompts for local network access and then allows http://*.local and targetAddressSpace requests from HTTPS pages.
It should also be noted that bug 1937501 ("Update mixed content checks for Private Network Access") described exactly this work, but was resolved as a duplicate of bug 1960577, which doesn't appear to implement the mixed content relaxation.
References:
MDN: https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Local_network_access
WICG explainer, "Mixed content" section: https://github.com/WICG/local-network-access/blob/main/explainer.md
Chrome: https://developer.chrome.com/blog/local-network-access
Comment 1•1 month ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Networking' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•1 month ago
|
||
This is part of LNA future tasks, will take as part of LNA 2.0.
Updated•1 month ago
|
Description
•