|
|
Log in / Subscribe / Register

How to do local services safely

How to do local services safely

Posted Jun 16, 2025 8:46 UTC (Mon) by farnz (subscriber, #17727)
In reply to: How to do local services safely by mathstuf
Parent article: Covert web-to-app tracking via localhost on Android

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.

If I were implementing this, I'd implement two things:

  1. An API that takes a struct sockaddr_t, and tells you the listener's identity - either a local identifier, or "not a loopback socket/pipe".
  2. An API that takes an fd, and tells you either the listener's identity, or "not a loopback socket/pipe".

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.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds