I originally started recording this on Twitter (see links) as I wasn't convinced I was seeing what I thought I was.
Raising this issue as have had opportunity to collect more data.
Jigsaw is Google's sister company, and Intra is an App which allows you to intercept DNS lookups and send them via DNS-over-HTTPS (DoH) instead. It works by acting as though it were a VPN, and then intercepting any packets on
UDP 53.
In early May, I noticed my home pi-hole interface was showing lookups from my phone, which runs Intra in order to send queries out to my DoH server on the net (
https://www.bentasker.co.uk/documentation/linux/407-building-and-running-your-own-dns-over-https-server)
The behaviour stopped shortly after I noticed it though - presumably (
https://twitter.com/bentasker/status/1129696578867011584) because I'd interacted with the phone and woken something up?
On Saturday whilst on someone else's Wifi I got a BT NXDOMAIN interception page (
https://twitter.com/bentasker/status/1132288203023704064) which should never happen.
This morning I've taken captures, and found queries hitting port 53 with no corresponding queries hitting my DoH server (despite the Intra Icon being in my notification panel).
Will update the comment in a minute with copies of notes/comments from earlier in the Twitter thread
Activity
2019-05-27 11:50:04
2019-05-27 11:51:02
2019-05-27 11:52:19
2019-05-27 11:52:19
2019-05-27 11:52:19
2019-05-27 11:55:44
We see the lookup come in
DNS logs show:
Interestingly, we don't have any queries from Intra, only Firefox's TRR. So when that failed and fell through, we used the system resolver.
I wonder then if Firefox is doing something funky rather than handing it over to the OS to handle?
Turning TRR off in Firefox (change
I now get nothing on port 53, but also nothing in the DoH server logs.
OK, placing a request for a non-existent domain on an authoritative I control:
So, the resolvers there are Google and BT. facepalm I know why... I've been a twat. Running the tcpdump on the wrong host, I recently dropped pi-hole onto the network. Re-running there
There we go
But the key point here, is there're no requests from Intra being received at the DoH server despite the fact it's icon is sat in my notification bar (see screenshot) and is ostensibly running
2019-05-27 11:56:41
2019-05-27 12:02:19
That's.... a while
Lets get an exact time
So, despite being sat "active" in the notification tray, Intra has been sat silently leaking my DNS queries since 22:35 UTC on 21 May (so, 6 days, give or take). That's dangerous....
2019-05-27 12:10:54
When I then went into Intra, queries immediately started being recorded at the DoH server, and Developer tools showed Intra running 3 processes and 1 service (see other screenshot).
2019-05-27 12:10:54
2019-05-27 12:10:54
2019-05-27 12:25:36
To test that theory, I ran MIUI's "Clear Memory" app.
The result is that Intra's icon remains in the notifications bar, but we stop receiving queries at the DoH server.
So, either I've found another way to repro this, or the underlying issue is that MIUI's memory management results in a silent failure. For avoidance of doubt, looking in Developer Options the memory management settings are currently at
- Background process limit: Standard Limit
- Turn on MIUI Optimization
2019-05-27 12:28:16
So
- Make sure Intra is running (i.e. go into it and come back out)
- press the task switcher button (little square at time of writing, used to be a hamburger menu)
- In the task switcher, hold down on Intra's window
- Three buttons should appear, one of which will be a padlock
- Press it
- In Task switcher Intra should now have a padlock next to it
2019-05-27 12:38:25
It looks hopeful, but need to wait and see now whether it silently breaks again.
As I noted here (https://twitter.com/bentasker/status/1129696593790291968) this is pretty concerning though. Intra was made for countries like China where even the smallest leakage could have major ramifications for the operator. Yet, on Chinese hardware, running Chinese software, made by one of China's most popular phone brands (Number 5 in 2018), Intra can silently fail and leak 100% of DNS queries for days.
Obviously, it's far less severe for me.
My leakage was mitigated by the fact I also had DoH/TRR configured in Firefox, so until this morning's testing the only queries (from my browsing) that would have leaked are where Firefox felt the query failed (so, NXDOMAIN or server unreachable). That's not without it's risk, but still a lot better than everything (and also avoidable by configuring
Which, actually, raises an interesting point in my mind. My intention had, ultimately, been to disable TRR in Firefox and let the system level DoH stub (in Android's case, Intra) handle queries, but this shows that that's not actually the wisest idea. As much as I personally dislike the idea of applications performing their own lookups, clearly it also acts as an important safety net against failures like this.
Even then, a double failure would be potentially severe (if less likely to occur).
2019-05-27 12:39:55
What will Intra's behaviour be if I (as a nefarious ISP) block it's access to the DoH server. Adding a firewall rule to do just that now...
2019-05-27 12:48:45
Intra tries to connect out to the DoH server, fails, tries again and eventually resolution is just considered to have failed. There's no fallback to local so the query gets sent to your local UDP DNS servers.
So a malicious network operator blocking your DoH server won't cause Intra to start sending your queries to your local DNS server. That something at least...
2019-05-27 12:49:06
2019-05-27 12:49:06
2019-05-27 12:50:58
2019-05-27 12:51:30
2019-05-27 13:01:37
2019-05-27 13:01:37
2019-05-27 13:01:41
2019-05-28 01:00:58
2019-05-29 12:17:50