os-issue-tracker icon indicating copy to clipboard operation
os-issue-tracker copied to clipboard

Can any app with Network permission trivially bypass VPN "Lockdown" ?

Open Saroumane opened this issue 2 years ago • 13 comments

Device : Pixel 6a Version : 13 (TQ3A.230805.001)

Steps to reproduce :

"Control group tests"

  • Wifi and 4G carrier up
  • Mullvad app up.
  • In GrapheneOS VPN Settings, regarding Mullvad VPN : * Always-on : ON * Block connections without VPN : OFF

open Termux, type : curl --interface wlan0 https://ipinfo.io/ ⇒ I get the real IP of my Wifi router, the connection did not get through the VPN curl --interface rmnet1 https://ipinfo.io/ ⇒ I get the real IP given by my “4G” provider, the connection did not get through the VPN

So far, so good I guess. (because "Block connections without VPN" is OFF)

Now the real tests :

  • Wifi and 4G carrier up
  • Mullvad app up
  • In GrapheneOS VPN Settings, regarding Mullvad VPN : * Always-on : ON * Block connections without VPN : ON (a.ka. the "VPN Lockdown")

open Termux, type : curl --interface wlan0 https://ipinfo.io/ ⇒ As expected I get “failed to connect, no route to host” curl --interface rmnet1 https://ipinfo.io/I still get the real IP given by my “4G” carrier : the connection was not blocked as expected and did not get through the VPN

Note : I reproduce this result with a Wireguard VPN config.

Questions

Did I miss something ? If Termux / curl can bypass the VPN Lockdown like this, I understand that any app with Network permission can also do it ? Is there a workaround to prevent that, apart from completely shutting down mobile data ?

Saroumane avatar Aug 12 '23 15:08 Saroumane

Cannot replicate.

flawedworld avatar Aug 13 '23 17:08 flawedworld

@Saroumane If you're modified the OS in some way and are no longer using official GrapheneOS, we need to know that.

thestinger avatar Aug 13 '23 17:08 thestinger

@flawedworld Wow, that was a quick close ! Could you please explain what part you don't reproduce ? Did you use a VPN ? Do you see the interface 'rmnet1' ? Do you reproduce the 3 first 'curl' results ?

@thestinger I did not modified GrapheneOS in any way. I'm not skilled enough for that (and I don't want to, I don't trust myself to keep it secured !)... Termux has standard permissions (Sensors/Notifications/Network) and I only used it to type these curl commands. By the way, I'm glad to see that you are still involved in this project, I thought you retired from it.

Just an idea : a week ago I used this device as a wifi hotspot, and I know that hotspots connections evade VPN, by design. Could it be linked to this behaviour ?

What else could I do to help ? (Please don't ask me to hard reset my device, I spent days to migrate data, app by app, from my old, unsupported Pixel 3a)

Saroumane avatar Aug 13 '23 18:08 Saroumane

@Saroumane I cannot reproduce this as well.

I use GrapheneOS in my Pixel 4A. Version: TQ3A.230805.001.2023080800

I tried the following with PIA VPN

  • Turned on VPN.
  • Turned on "Always On" VPN option. (This enabled the "Block connections without VPN" option)
  • Turned on "Block connections without VPN".
  • Tried curl-ing from non VPN interfaces (wlan0, rmnet_data1, rmnet_data3 and my connections were blocked as expected)
  • Tried curl-ing from the tun0 interface and it works as expected.

afeedhshaji avatar Aug 26 '23 19:08 afeedhshaji

Very interesting : https://x.com/GrapheneOS/status/1841236289263116381 Maybe I was not crazy after all, even if I could not describe all the trigerring conditions of the leak I found !

For the record I still reproduce the problem as of today :

From termux : curl --interface rmnet1 https://ipinfo.io/ ⇒ I still get the real IP given by my “4G” carrier : the connection was not blocked as expected and did not get through the VPN (Despite Block connections without VPN : On)

Saroumane avatar Oct 02 '24 08:10 Saroumane

What you're describing is unrelated to our thread and cannot be reproduced. Appears to be because of how you've configured your device via ADB.

thestinger avatar Oct 02 '24 08:10 thestinger

@Saroumane I will investigate this further.

Can you please confirm if your device is rooted or not?

u-fred avatar Oct 02 '24 08:10 u-fred

@thestinger : I don't remember doing anything via ADB, apart of trying to backup some apps. Do you have a specific action in mind ?

@u-fred : Thanks for the investigation. I never rooted any device. I'm fully convinced (by GoS team) that it is a bad idea, security-wise. In the meantime, I will also set up a brand new profile on my Pixel with only the VPN app and termux installed, to see if I can reproduce what I see on my owner profile.

Saroumane avatar Oct 02 '24 11:10 Saroumane

In the meantime, I will also set up a brand new profile on my Pixel with only the VPN app and termux installed, to see if I can reproduce what I see on my owner profile.

This won't be possible. Termux can only run in the owner profile unless they changed that recently.

matchboxbananasynergy avatar Oct 02 '24 16:10 matchboxbananasynergy

@Saroumane would you be able to contact me on Matrix/Discord/Telegram to resolve this? https://grapheneos.org/contact#community-chat

We can't reproduce it internally and that makes it difficult to fix.

u-fred avatar Oct 02 '24 20:10 u-fred

@Saroumane

u-fred avatar Oct 05 '24 20:10 u-fred

Thanks @u-fred for believing in my report and managing to reproduce the problem !

Saroumane avatar Oct 06 '24 00:10 Saroumane

Does the latest GoS update already include the fix ?

Saroumane avatar Oct 26 '24 08:10 Saroumane

No, we're scared to ship it due to compatibility risk so it needs a dedicated release when we don't have other urgent changes.

thestinger avatar Oct 26 '24 12:10 thestinger

@thestinger:

No, we're scared to ship it due to compatibility risk so it needs a dedicated release when we don't have other urgent changes.

While outrageous (what could possibly be more urgent/higher priority than network traffic leaving a device in an impermissible way?), I respect the candidness of this comment.

mattcheau avatar Apr 20 '25 20:04 mattcheau

The main reason it hasn't been shipped yet is that the person working on it needed to deal with other things and hasn't been able to work on GrapheneOS for a while. We can get it done soon when they're back.

thestinger avatar Apr 20 '25 20:04 thestinger

See https://github.com/GrapheneOS/platform_packages_modules_Connectivity/pull/33.

thestinger avatar Jul 27 '25 18:07 thestinger