Hello all,
I noticed that Brave does not restrict the interaction of external websites with the local network. In my opinion, this poses an unnecessary privacy risk, as it can be abused to scan for ports or identify running services, network topology, etc. I see no legitimate use case that justifies this behaviour (please correct me if I am wrong on this point). It also poses a security risk when having vulnerable software running locally.
I know there are already countermeasures in place (blocked ports, throttling), which dont seem to fight the root problem.
To answer your question, I was not able to observe any connection attempts that bypass this blacklist. Still I would be surprised if it wasn’t already being used in the wild.
I dont know the inner workings of brave, but is a blacklist really the only approach possible to prevent this?
I have also found the following (no guarantee of completeness):
the entire 127.0.0.0/8 address block (that is 16,777,214 addresses - maybe “127.” could be blocked for this purpose, but then again one needs to consider various encodings)
You’re right to point out that the whole /8 is reserved for the loopback address, but on my machine, only 127.0.0.1 gets routed back to my machine. It doesn’t look like using other addresses in this range would be a reliable way to portscan a user’s machine. Have you seen evidence of other addresses being commonly exposed by default on other operating systems for example?
I did include these encodings on my test page but I found that Chrome normalizes them to the usual notation before passing them to the adblock layer and so we don’t need to worry about them, they all get blocked by 127.0.0.1 for example.
You’re right. I looked a bit more into this and I found that:
the whole /8 is routed to the loopback interface
but not all services are listening on the whole /8
For example, on my machine, if I nmap 127.0.0.1, I get:
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
25/tcp open smtp Postfix smtpd
whereas if I nmap 127.0.1.25, I get only:
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
So it’s probably not a reliable way to portscan a local machine (you would miss the services bound to 127.0.0.1), but it does leak some information about the services that listen on all interfaces.
I’ll file a separate issue for this since the way we fixed it for the other addresses isn’t going to work here: