0

I am reading about sandboxing, specifically for Android and Linux based systems (like snap apps). Each app is isolated and can only see its own files, i.e. each app has its own environment. What I don't understand is why can each app see all network traffic being sent? On Android I can install HTTP Canary which works by being a VPN and then allows you to see all traffic sent from your device. On my PC I can use Wireshark and monitor all traffic sent from my computer. My question is, why is this possible? Why do all programs have the ability to see all network traffic? Shouldn't true sandboxing result in only each app being able to see its own network traffic? I am thinking that it's because all programs have access to the network adapter, i.e. all programs should be able to use the network adapter, and thus each program can see everything that enters and exits the network adapter. Wouldn't it be better if some form of channels were used, so each app can only see its own channel in the network adapter? I know that as soon as the traffic leaves the device, every device nearby can monitor the wireless traffic, as it is in the air (it's encrypted however). However it's only before it leaves the network adapter that I don't understand, why all programs can see all traffic.

4
  • 1
    "Why do all programs have the ability to see all network traffic?" - they don't. Designated programs with special permissions have the ability, but not all programs. – Steffen Ullrich Jun 5 '20 at 22:38
  • My question remains the same, how can these designated programs do it? Do they monitor everything that goes through your network adapter? – networktraffichuy Jun 5 '20 at 22:40
  • 1
    "Do they monitor everything that goes through your network adapter?" - correct. And they have the permission to do this. Similar to how programs with special permissions can access all files on the system while normal programs can't. – Steffen Ullrich Jun 5 '20 at 22:41
  • Since I am not root on Android, how can a VPN work? Shouldn't the app have root priviliege before it can monitor my network card? – networktraffichuy Jun 5 '20 at 22:45
1

Sniffing network traffic is typically a privileged action. An unprivileged user does not have the ability to perform a packet capture by default.

You have outlined two scenarios (HTTP Canary and Wireshark) that require special privileges. In the first case, HTTP Canary must be explicitly enabled as a VPN by the device owner. An app cannot obtain this privilege on its own, and a user should not grant this privilege to an app that they do not trust to view all of their traffic.

In the second case, an unprivileged user cannot sniff using Wireshark without extra privileges. On Linux, this means being a member of the system "wireshark" group, or running it as root. On Windows, I believe this requires a driver installation that needs administrator privileges.

Since it requires extra privileges anyway, I don't think it really is a concern related to sandboxing. To conclude, packet sniffing is not something trivial that any application can do without acquiring special privileges. Even then, lots of traffic will not be visible since HTTPS is used almost universally.

5
  • Since I am not root on Android, how can a VPN work? Shouldn't the app have root priviliege before it can monitor my network card? – networktraffichuy Jun 5 '20 at 22:44
  • @networktraffichuy same way you perform other privileged actions like installing apps, software upgrades, etc. To simplify, there are privileged daemons running as root, and the unprivileged UI requests privileged things by communicating with those services. It's also not monitoring your network card. The VPN functionality sends all traffic to the app that requests it. – multithr3at3d Jun 5 '20 at 22:54
  • I am sorry but I am not sure I understand. I have ProtonVPN intalled on my android device, so what you mean is that the ProtonVPN app does not have access to my network card? How does it get all the traffic and encrypt it then? – networktraffichuy Jun 5 '20 at 22:57
  • @networktraffichuy some Android service that runs as root is responsible for sending all traffic to the app. I do not know the exact internals. But note that the VPN app can choose which apps should have their traffic sent through the VPN. – multithr3at3d Jun 5 '20 at 22:59
  • @networktraffichuy I'm not sure of your background, but the literature is developer-focused 1 2. Well, the system settings let you choose which VPN app, but the VPN app itself often lets you pick apps to send through it. – multithr3at3d Jun 5 '20 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.