Covert web-to-app tracking via localhost on Android
While there are subtle differences in the way Meta and Yandex bridge web and mobile contexts and identifiers, both of them essentially misuse the unvetted access to localhost sockets. The Android OS allows any installed app with the INTERNET permission to open a listening socket on the loopback interface (127.0.0.1). Browsers running on the same device also access this interface without user consent or platform mediation. This allows JavaScript embedded on web pages to communicate with native Android apps and share identifiers and browsing habits, bridging ephemeral web identifiers to long-lived mobile app IDs using standard Web APIs.
This backdoor, the use of which has evidently stopped since its disclosure,
allow tracking of users across sites regardless of cookie policies or use of
incognito browser modes.
Posted Jun 11, 2025 13:31 UTC (Wed)
by fraetor (subscriber, #161147)
[Link] (23 responses)
Posted Jun 11, 2025 13:36 UTC (Wed)
by koverstreet (✭ supporter ✭, #4296)
[Link] (17 responses)
Posted Jun 11, 2025 13:41 UTC (Wed)
by xav (guest, #18536)
[Link] (15 responses)
Posted Jun 11, 2025 15:02 UTC (Wed)
by ms (subscriber, #41272)
[Link]
Posted Jun 11, 2025 16:51 UTC (Wed)
by koverstreet (✭ supporter ✭, #4296)
[Link] (4 responses)
Posted Jun 12, 2025 6:44 UTC (Thu)
by marcH (subscriber, #57642)
[Link]
Posted Jun 13, 2025 6:54 UTC (Fri)
by oldtomas (guest, #72579)
[Link]
Education should not just focus on (individual) users [1], but also on society in general. Elsewhere in the commentary there are good contributions as to how lawmakers shouldn't let those bad actors get away with it: but then, lawmakers should understand what's at stake!
I see that as a corollary of the old saw "you can't solve social problems by technological means".
[1] But this part is essential, too!
Posted Jun 13, 2025 20:37 UTC (Fri)
by bmur (guest, #52954)
[Link]
All the message needs to say is:
"Allow this permission to continue using Facebook."
Everyone: *shrug* Allow.
Posted Jun 14, 2025 10:37 UTC (Sat)
by Wol (subscriber, #4433)
[Link]
Are you sure?
Ime literacy generally (and technical is included) goes down over time WITHIN A COHORT.
That's why IQ tests don't measure "the general populace", rather they measure the general populace against their own age group. Different age groups score differently, but individuals tend to score consistently against their peers.
Cheers,
Posted Jun 11, 2025 18:14 UTC (Wed)
by mathstuf (subscriber, #69389)
[Link] (8 responses)
Posted Jun 11, 2025 21:18 UTC (Wed)
by fraetor (subscriber, #161147)
[Link] (7 responses)
In the case of this specific proposal, perhaps you don't mind facebook.com in your browser talking to the Facebook app, but would for other origins.
Various cross-site request forgery prevention mechanism exist to prevent a random site from affecting another site, but in this case the localhost server wants to be affected, which means you would have to prevent the entire request.
A static permission on the app sounds like a sensible step, as it would allow app store review to catch malicious code while still allowing origins to opt-in.
Posted Jun 12, 2025 5:29 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link]
Posted Jun 15, 2025 16:26 UTC (Sun)
by KJ7RRV (subscriber, #153595)
[Link] (5 responses)
> Do you want to allow facebook.com/legit-site-with-ads.com/sketchy-site.com to connect to the Facebook app on your phone? Tap "Deny" unless there is a clear reason that you understand why this is needed, because this can enable trackers to break privacy protections and see your activity across the Internet.
> [Protect my privacy: *Deny*]
Posted Jun 15, 2025 16:47 UTC (Sun)
by mathstuf (subscriber, #69389)
[Link] (4 responses)
Posted Jun 15, 2025 17:40 UTC (Sun)
by notriddle (subscriber, #130608)
[Link] (2 responses)
Posted Jun 15, 2025 18:44 UTC (Sun)
by mathstuf (subscriber, #69389)
[Link] (1 responses)
Posted Jun 15, 2025 19:11 UTC (Sun)
by johill (subscriber, #25196)
[Link]
Posted Jun 16, 2025 8:46 UTC (Mon)
by farnz (subscriber, #17727)
[Link]
If I were implementing this, I'd implement two things:
With this in place, API 1 lets the browser prompt you before you connect. API 2 lets the browser drop the connection and warn the user that the applications identified by API 1 and API 2 are potentially malicious before transferring data, thus deterring "clever" ideas around transferring a socket between applications.
Posted Jun 11, 2025 17:44 UTC (Wed)
by notriddle (subscriber, #130608)
[Link]
And, in this case, it doesn't seem necessary. Instead of having the website ask permission to talk to the app, the app should ask permission to provide services to websites. That makes it a lot easier to build the feature in a fine-grained, legible way, because the storefront can refuse to ship an app if it breaks when the user says "No", can allow an app to expose services only to certain top-level origins (and make the warning a lot more obnoxious if an app wants to provide a service to every domain on the web), and can track historical changes to the policy for all distributed versions of the app (no gaslighting people by doing the attack on a random 1% of the population).
That's already how it works if an app wants to replace a website wholesale[^1]. They should just extend it to do the same thing with apps that want to provide services to a website without replacing it.
Posted Jun 11, 2025 14:32 UTC (Wed)
by DemiMarie (subscriber, #164188)
[Link]
Posted Jun 11, 2025 15:39 UTC (Wed)
by farnz (subscriber, #17727)
[Link] (3 responses)
I'd therefore guess that you could restrict this sort of exploit without completely prohibiting access to local services in a similar way to the way that you can't use file:/// URLs in a document served over HTTPS. You'd have rules that say things like "if you fetched the top-level document over loopback, then you can also connect to services over loopback. Otherwise, traffic over loopback interfaces is blocked"; then, if I set up the DNS label my-service.example.com to point to a loopback address, and I have my app listen to loopback, you can go to https://my-service.example.com/ and have access to loopback services, but if you instead navigated to https://new-customer.example.com/ (connecting over the network to my webserver), you'd have no access to loopback services, even if you accessed them via the name my-service.example.com.
This would let a legitimate app serve up a web page locally that you could use to access loopback services, but would prohibit me from doing so from a remote site; I'd have to set up a local proxy, and have the browser UI show that you're accessing something like https://my-service.example.com:12345/proxy/new-customer.example.com/site/etc
You're still not fully protected, but it at least stops malicious actors doing this stealthily.
Posted Jun 12, 2025 0:42 UTC (Thu)
by wahern (subscriber, #37304)
[Link] (2 responses)
Posted Jun 12, 2025 8:50 UTC (Thu)
by farnz (subscriber, #17727)
[Link] (1 responses)
It's a distinct improvement, however.
Posted Jun 12, 2025 10:12 UTC (Thu)
by Funcan (subscriber, #44209)
[Link]
Posted Jun 11, 2025 22:49 UTC (Wed)
by Karellen (subscriber, #67644)
[Link]
Make a decent website.
Posted Jun 12, 2025 3:51 UTC (Thu)
by KJ7RRV (subscriber, #153595)
[Link] (3 responses)
Also, this seems to be somewhat related to the 0.0.0.0 Day [1] vulnerability affecting browsers on Mac and Linux? The difference is that with Local Mess, the localhost listener is part of the exploit, whereas with 0.0.0.0 Day, it is the target being exploited, but both involve connections to local ports.
I believe my ZeroTest vulnerability checker [2] for 0.0.0.0 Day should also detect listeners intended to exploit Local Mess (since it is essentially a port scanner), and installing uBlock Origin or Stop PNA [3], an extension written to protect against 0.0.0.0 Day, should protect against Local Mess as well.
Of course, these only work on mobile browsers that support extensions; Firefox is the only one that I know of that does. uBlock Origin, as a recommended extension, can be easily installed in the default configuration; Stop PNA must be sideloaded [4], which is somewhat harder.
[1] https://www.oligo.security/blog/0-0-0-0-day-exploiting-lo...
Posted Jun 12, 2025 3:55 UTC (Thu)
by KJ7RRV (subscriber, #153595)
[Link]
> Q: Does this only affect Android users? What about iOS or other platforms?
> A: We have only obtained empirical evidence of this web-to-native ID bridging Meta and Yandex web scripts, which exclusively targeted mobile Android users. No evidence of abuse has been observed in iOS browsers and apps that we tested. That said, similar data sharing between iOS browsers and native apps is technically possible. iOS browsers, which are all based on WebKit, allow developers to programmatically establish localhost connections and apps can listen on local ports. It is possible that technical and policy restrictions for running native apps in the background may explain why iOS users were not targeted by these trackers. We note, however, that our iOS analysis is still preliminary and this behavior might have also violated PlayStore policies. Beyond mobile platforms, web-to-native ID bridging could also pose a threat on desktop OSes and smart TV platforms, but we have not yet investigated these platforms.
Posted Jun 12, 2025 9:52 UTC (Thu)
by grawity (subscriber, #80596)
[Link] (1 responses)
As I understand it – it would, but... most desktop platforms don't have that kind of application software installed (nor is such software *available* at all, when it comes to the usual suspects – when was the last time a "Facebook" desktop app existed for Windows? probably in Win8 UWP era?), unlike mobile platforms where having such software is "normal" and commonplace.
> Also, this seems to be somewhat related to the 0.0.0.0 Day
"the 0.0.0.0 Day"? ...I'm sorry, but that sounds like such a grandiose name for what seems like a very regular vulnerability. It definitely beats "Meltdown" by a mile. What will come next? "git checkout master of Disaster"? "Ultra LaserJet"? "Segfault of Doctor Doom"?
Posted Jun 12, 2025 11:48 UTC (Thu)
by rschroev (subscriber, #4164)
[Link]
WhatsApp (which is also Meta) has an app. It's supposed goal is to enable/improve calls and screen sharing on your desktop, but it wouldn't totally surprise me to learn they also use it for exploits like this.
Posted Jun 12, 2025 9:49 UTC (Thu)
by paulj (subscriber, #341)
[Link] (2 responses)
WTF? How is this not a clear cross-site exploit? How is this allowed?!
Posted Jun 12, 2025 11:35 UTC (Thu)
by excors (subscriber, #95769)
[Link] (1 responses)
The problem here is that browsers and OSes try to implement privacy protection with sandboxing etc, with the policy that apps are allowed to persistently identify users but web sites aren't, and Meta and Yandex set up covert channels between their apps and web sites to violate that policy.
Protections like https://github.com/explainers-by-googlers/local-network-a... are not intended for this case (though they might fix it anyway, as a side effect): they're trying to e.g. prevent random web pages from accessing http://192.168.0.1/router.cgi?firewall=off in case the router manufacturer mistakenly assumes that any HTTP request from the local network must be from a trusted user and does not perform appropriate authentication.
Chrome's previous proposal (PNA) allowed local services to opt in to promptless cross-site requests (via the CORS pre-flight request), which wouldn't have blocked this covert channel since the Meta/Yandex apps could have just opted in. They say the main reason they dropped that in the new proposal is that it's much easier to add a permission prompt to one browser than to add the opt-in code to the many local services that currently rely on cross-site requests for legitimate purposes; it was for practicality and compatibility, not for improved security or privacy.
Posted Jun 12, 2025 12:09 UTC (Thu)
by paulj (subscriber, #341)
[Link]
How... I honestly thought this was something browsers simply did not allow. How..
Posted Jun 12, 2025 10:17 UTC (Thu)
by Funcan (subscriber, #44209)
[Link] (2 responses)
Alter the risk-to-reward of serving advertising cookies and fewer sites will be happy serving up literally hundreds in every site visit
Posted Jun 12, 2025 10:55 UTC (Thu)
by Lyco (subscriber, #133637)
[Link] (1 responses)
I am quite disappointed in the discussion here: several people suggest "fixes" like asking the user if application should be allowed to communicate, as if this is something that users are (or should be) able to decide, shifting the responsibility to the victims. We have enough mental issues in the world, let's not make paranoia mandatory to keep basic human rights.
Blaming users is completely backwards: it's Meta and Yandex who decided to spy on users to enrich themselves, and they should bear the responsibility instead. Put large fine on Meta and Yandex - large enough to erase all gains from this conduct - and send the executives responsible into a jail.
Posted Jun 12, 2025 11:43 UTC (Thu)
by paulj (subscriber, #341)
[Link]
Posted Jun 12, 2025 14:49 UTC (Thu)
by kolAflash (subscriber, #168136)
[Link] (7 responses)
I've actually started looking into the whole surrounding topic about a year before the current discussion came up. Simply because I realized, that developers usually assume opening TCP ports on locahost (127.0.0.1/8, ::1/128) and in local networks (192.168.0.0, 169.254.0.0/16, fe80::/64 and all the others) is OK without any security or just some obfuscation. For localhost that would theoretically be even true, if there wouldn't be for web sites which we now a days open not just in browsers, but in all kinds of applications. Just think of a chat app which accesses HTTP addresses from messages to generate previews. And JavaScript code, as well as embedded resource HTTP URLs (e.g. images) can open TCP connections to arbitrary IP addresses.
So to all developers + system admins (including myself 2 years ago):
.
At least the Chrome developers seem to think about this for some time.
Firefox seems to have a whole list of tickets about this since decades! And now it seems they might actually start to work on it. So don't say anyone warned about this before ;-)
Some of my additional notes.
.
But even beside actual web browsers we have all kinds of different applications running dynamically loaded, arbitrary JavaScript code from the Internet all the time and allowing it to make arbitrary HTTP connection. Do email clients run JavaScript code embedded in mails? At least email load embedded HTTP resources in mails, which might access local network resources. Just think of Thunderbird, MS-Outlook, Apple Mail and the huge list of service provider specific Android+iOS mail clients out there, supporting HTML+HTTP content.
Bye the way, I found this nice overview of the currently discussed problems: https://localmess.github.io/
So since knowing that, I keep much more of an eye on closing all unneeded (localhost) TCP ports on my system. I even closed the CUPS port 631, even I find the CUPS web UI quite helpful. Instead I try to use UNIX sockets instead where possible. You can even forward UNIX sockets via ssh and for example VNC software usually also supports them.
.
As a workaround, I currently run my desktop Firefox using this command:
setsid --fork systemd-run --user --scope --slice=no_localhost_net firefox; sudo bash -c "for dst in 127.0.0.1/8 0.0.0.0/32; do /usr/sbin/iptables -A OUTPUT -p tcp --destination \$dst -m cgroup --path 'user.slice/user-${UID}.slice/user@${UID}.service/no_localhost_net.slice' -j REJECT; done"; sudo bash -c "for dst in ::1/128 ::/128; do /usr/sbin/ip6tables -A OUTPUT -p tcp --destination \$dst -m cgroup --path "user.slice/user-${UID}.slice/user@${UID}.service/no_localhost_net.slice" -j REJECT; done";
Next step will probably be, to reverse this and allow localhost + local network access only to white listed applications.
So in the end web browsers can't probably fix this for good. Instead operating systems must consider listening on localhost a privileged operation. And programs having this privilege must fulfil the full security responsibilities which come with that. If you don't want that, use UNIX sockets or any other non-network IPC mechanism.
... I'll just walk over to my balcony and do some gardening.
Posted Jun 13, 2025 2:29 UTC (Fri)
by xecycle (subscriber, #140261)
[Link]
Ugh... Well, some months ago I checked whether I can tell nft to filter loopback traffic by the two cgroups of the two participating sockets, but failed. Resorting to sudo is... a risk I don't want to take. Instead you can place it into a dedicated slice, and tell nft to filter on that cgroup.
Posted Jun 13, 2025 8:17 UTC (Fri)
by nim-nim (subscriber, #34454)
[Link] (5 responses)
That‘s true on an operating system you control. You can deploy all sorts of tools to identify and reel in malware.
The problem here is that localhost belongs to the mobile OS, and the mobile OS is not controlled by you but by Google, Apple, or the device maker, and all those entities are engaging in a cat and mouse game with the legislator to pull as much info on you as possible to feed you scams and propaganda.
I’ve slowly come to the conclusion that targeted advertising in any form is evil and should be legislated away. It makes it all too easy to identify marks and slowly overwhelm their common sense with a barrage of ads, propaganda, and echo chamber effects (and conversely fly under the radar of society as a whole by feeding extreme content to select audiences that won’t condemn them). It enables police states. We are seeing the results of allowing this system today (both in the politics being pushed, and who pretends to the role of the puppet master today; see Palantir and Peter Thiel).
I don’t like a advertising as a whole but at least the lack of targeting in last century’s TV adverts prevented the promotion of “let’s kill you neighbour or classmate” messaging (because the neighbour or classmate would also see the same ads).
Posted Jun 13, 2025 10:27 UTC (Fri)
by Wol (subscriber, #4433)
[Link] (2 responses)
I've always hated targeted advertising. Not least because it's nearly always "close but no cigar". If I buy birthday presents for my nieces and grand-kids, I don't want to be pestered to buy more. Especially when the advertising is clueless to the fact that kids grow up :-)
Likewise, if I buy Nikon camera gear, the resulting barrage of Canon adverts is extremely annoying. Etc etc.
I NEVER give permission for targeted advertising.
The other big concern of course is all the medical stuff. Less so over here, as so much is regulated, but the sheer LACK of science in the practice of medicine is appalling. So much stuff is driven by "a new study has proved ..." loudly promoted by journalist and advertising hacks who don't have any real understanding of what they're doing. The diet industry is a major case in point ...
Cheers,
Posted Jun 13, 2025 13:07 UTC (Fri)
by pizza (subscriber, #46)
[Link] (1 responses)
....Or when I buy a new faucet or showerhead, why exactly would ads trying to get me to buy *more* faucets be relevant? Am I supposed to be collecting them as an new-in-box "investment"?
(I'd say "let them waste their money" but it all comes out of their customers' pockets eventually..)
Posted Jun 13, 2025 18:42 UTC (Fri)
by mathstuf (subscriber, #69389)
[Link]
Posted Jun 16, 2025 7:39 UTC (Mon)
by taladar (subscriber, #68407)
[Link] (1 responses)
Basically you can blame a lot of drug use (including alcohol and tobacco and prescription drugs) on advertising, a lot of health problems from bad diets, climate change from advertising of fossil fuel, automotive, aviation and travel industries,...
And that is not even accounting for the horrors inflicted upon humanity by political advertising (usually referred to as propaganda when seen in a negative light).
But true, the targeted aspect adds things like the building of a world-wide surveillance capability that surpasses most intelligence agency's wet dreams.
Posted Jun 16, 2025 8:20 UTC (Mon)
by nim-nim (subscriber, #34454)
[Link]
Traditional advertising relied on brute force and brute force is obvious enough society as a whole can decide if the messaging is acceptable or not.
How to do local services safely
How to do local services safely
How to do local services safely
How to do local services safely
How to do local services safely
How to do local services safely
How to do local services safely
How to do local services safely
How to do local services safely
Wol
How to do local services safely
How to do local services safely
How to do local services safely
How to do local services safely
> [I understand the risk; *Allow*]
How to do local services safely
How to do local services safely
How to do local services safely
How to do local services safely
The system as a whole knows (if nothing else, the kernel knows the process that's got the socket open), and thus Android could provide an API that maps from local socket to Android application that has the socket open.
How to do local services safely
How to do local services safely
How to do local services safely
The underlying problem here is that you're silently crossing security domains. You think you're accessing https://news-site.example.com/, but you're actually accessing both https://news-site.example.com/ and something on localhost (in the case of Yandex, a HTTPS listener, in the case of Meta, a STUN listener).
Crossing security domains
Crossing security domains
That proposal does, unfortunately, run into the "prompt for insecurity" problem, which means that it doesn't fully block the described exploit - not least because sites using the exploit could socially engineer their way to local network access.
Crossing security domains
Crossing security domains
Bloody apps
Not just an Android vulnerability? Also, related to 0.0.0.0 Day?
[2] http://zerotest.kj7rrv.com/
[3] https://codeberg.org/gs/stop-pna
[4] https://www.ghacks.net/2023/12/18/firefox-nightly-for-and...
Not just an Android vulnerability? Also, related to 0.0.0.0 Day?
Not just an Android vulnerability? Also, related to 0.0.0.0 Day?
Not just an Android vulnerability? Also, related to 0.0.0.0 Day?
Your browser lets remote code send packets to localhost???!
Your browser lets remote code send packets to localhost???!
Your browser lets remote code send packets to localhost???!
Not all fixes need to be technical
Not all fixes need to be technical
Not all fixes need to be technical
browser development, bigger problem, workarounds
localhost and your local network is absolutely NOT safe!
2021-08-26: https://developer.chrome.com/blog/private-network-access-...
2025-06-09: https://developer.chrome.com/blog/local-network-access?hl=en
The second link includes a screen shot of the dialogue you'll get when you enable this setting in the upcoming Chrome-138.
chrome://flags/#local-network-access-check
Some more Chromium bits about this: https://issues.chromium.org/issues/40083783
central ticket: https://bugzilla.mozilla.org/show_bug.cgi?id=1481298
What the standard says:
https://wicg.github.io/private-network-access/
https://github.com/mozilla/standards-positions/issues/143
Try out things yourself:
http://samy.pl/webscan/
https://github.com/samyk/webscan
But there's a huge bunch of other software out there, allowing HTML and maybe even JavaScript code just downloaded from the Internet to make local HTTP connections. Think of the web view in the Steam client. Or Electron based messaging apps.
Related: https://github.com/distcc/distcc/discussions/517
Unfortunately OpenSSH in particular, usually praised for it's security, unfortunately does -X forwarding via TCP instead of using UNIX sockets. I've put a workaround here, on how to forward X11 via UNIX socket instead.
https://bugzilla.mindrot.org/show_bug.cgi?id=3695
browser development, bigger problem, workarounds
browser development, bigger problem, workarounds
browser development, bigger problem, workarounds
Wol
browser development, bigger problem, workarounds
browser development, bigger problem, workarounds
browser development, bigger problem, workarounds
browser development, bigger problem, workarounds