RedditPP Mascot

RedditPP

r/cybersecurity • … • u/Noobmode

Andrew Morris finds iOS AdGuard is written by Russians and injects 20K lines into your browser

Text for those that dont want to go to LinkedIn and see Andrew's post:

gm linkedin! Hope everyone enjoyed the superbowl! It's just about as american as it gets. I didn't watch it because I haven't unpacked my TV yet. Instead, I spent the evening arguing with my stepbrother about DNS, VPNs, and trust on the internet.

He runs AdGuard on his phone to block ads. His favorite feature is that it fixes up websites so there aren't any ugly grey spots on the website where an ad WOULD be. That freaked me out because that told me that the app can rewrite the DOM in his browser. He informed me that its all good because he hasn't given the permission to iOS to allow Adguard to mange his DNS. And yet! the ads were being overwritten. Curious!

So I ripped down the adguard iOS app's code from github. It hasn't had any commits in 4 months, which I found weird for an app with millions of users. Digging in a bit further, I learned that the library that adjudicates DNS is actually closed source. I did a tiny bit of lightning triage on the compiled binary itself but nothing suspicious leapt out at me. Because of the nature of the app store, I don't even KNOW that the code on github is the same as the code compiled into the iphone app.

While reversing the app and reviewing the code I learned that the way they fix up ads is by executing 20,000+ lines of javascript on EVERY SINGLE WEBSITE you load. The javascript is pulled remotely every 6 hours.

I kept digging and learned that Adguard is registered in Cyprus but all the developers live in Moscow. The hostnames from the commit logs are all from workstations with .ru TLDs and every single commit comes with a UTC+0300 (moscow timezone) timezone locale.

I have no evidence that Adguard is up to no good! But loading 20,000+ lines of javascript from a team of developers in moscow and executing it on every single page you load in Safari feels.... worse than ads! Maybe I'm just paranoid. I went as far as ordering a jailbroken iphone on ebay to yoink the app off my phone and reverse engineer the binary itself straight from the horses mouth.

The point of the story is sometimes our lack of trust in *everyone* results in deeply concentrated trust in *someone* who might live in Moscow. This can make us *feel* better, but can have the opposite effect.

What does the braintrust on linkedin think?

— 0