225 points · by mritzmann · 5y ago · 182 comments
Certainly, they now have the option of trying to force google into delivering modified apps to certain people. This situation changes the trust model for e.g. signal from "do you trust the app developer" to "do you trust google" against the pressures of hacking and legal requirement of cooperation. The fact that reproducible builds become _that much_ more difficult with this is extra bad. It takes away a rather effective "after the fact" detection mechanism for these kinds of abuses.
It seems obvious to me there are plenty of important app developers (like signal) that are less likely to bow before the long arm of the US than the google play store. Also because for a principled developer, their app is likely 100% of their business. Whereas for google, any app is only a small part of their business. Google simply has much less incentive to defend the users of a single app that the developer.
Hence, it seems to me that this situation is realistically going to lead to more ways for law enforcement to access secret data on your devices. Whether this is part of the motivation for this change or not, the effect seems unavoidable.
Of course whoever controls the OS and app stores can already access all device data. They don’t need to fiddle with the apps to do that.
Who signs what doesn’t change the threat models.
Hence, google play store cannot just give my an updated backdoored version of signal or whatsapp unless they can get those developers to sign it. With this new system google could unilaterally decide to push such an update. Either to everyone, or just to a few select people.
> Who signs what doesn’t change the threat models.
It very VERY much does. He who signs is he who is able to modify code. If it did not, what value do signatures even have? It seems you are arguing that, since google already controls android, they already control this data anyway. Thing is, the OS on my phone is already on there. Updates need to go through the manufacturer, and are hard to target. The play-store itself cannot read my signal messages.
Hence, for google to read my signal messages, right now, they would need to have a pre-existing backdoor in android, or run an exploit through the play-store. With the new system, they could just push an update to my signal app. (If signal were to use the new system). That, in my opinion, warrants changing the threat model quite a bit.
Sure, just like how if you let's say own Google Play Store and own those updating keys, you can change it (selectively most likely) to skip checking the signed updates.
They own the full pipeline so if they want, you really stand no chance unless you're running your own OS.
It's a verification made by the OS itself. F-Droid themselves compile and signs the binaries offered by their repository, which everyone seems to be fine with. I believe they're also working towards reproducible builds to let others independently verify the compilation matches the source code.
Signing gives some semblance of control between the untrusted developer and the trusted App Store. It doesn’t do more that stop 3rd party app stores on the link between store and phone.
However, it also makes developer signing harder (so google decided to eliminate it) because every app bundle is going to be a different file. As a side effect, this also kills 'reproducible builds', unless the bundling process by google is itself reproducible.
This is the same process that package maintainers (e.g. Debian, Mozilla, Tor) go through to produce reproducible (i.e. verifiable, deterministic) binary packages: they enable arbitrary users to run a copy of the packaging + distribution infrastructure on their own machine, such that they can watch it all go and see that it spits out the same thing the remote server does.
Apps that currently provide reproducible builds: Signal, Threema, Telegram. (Probably others as well.)
[1] Google could easily verify this by making the tool output a fixed point; running the tool on an already processed bundle shouldn't change anything.
> This means that Google can (or can be forced to) distribute backdoored versions of popular apps to targeted people. The app you are downloading may be different from the app your neighbour is downloading. And the app signature will be perfectly valid for both of them.
Google already controls the operating system, the installer, and the SDKs you used to develop your Android app in the first place. If they wanted to backdoor your app there are already plenty of opportunities to do so at multiple levels throughout this chain. Retaining your own signing keys does not eliminate this potential threat, so you still have to trust them. If you don't, then you should avoid using Android entirely.
It's less straightforward to backdoor the OS/sdk because it's open source and built by various vendors. AFAIK the play store doesn't have a custom installer to handle installs, that's handled by the operating system itself. The play store has special permissions to install apps programmatically, but AFAIK it doesn't have ability to bypass the signature check, which is why this change is being made in the first place.
Not for devices running Google Play Services. If your device is running AOSP with absolutely zero Google services then maybe that's the case (although I'm not even sure that's true at the firmware/driver level), but if you'll never use the Play Store then Play Store restrictions don't really affect you in the first place.
I also think you're seriously underestimating or misunderstanding the potential attack vectors here. You don't need to deliver a blatantly obvious backdoor that can be easily found in the AOSP source code. Consider the history of 0-day RCE exploits on the Android platform and then consider the fact that such exploits can be subtly introduced in a non-obvious way that gives you plausible deniability if discovered. Now consider that you have your own closed-source and privileged code running on billions of Android devices that could take advantage of the 0-days you introduced yourself.
Open source doesn't protect you at all against Google.
AFAIK the OS has checks to prevent "updating" to an APK with different signature.
>The Play Services have silent permissions to backup and restore app data.
It looks like apps can opt out of it. https://developer.android.com/guide/topics/data/autobackup#E... It's unclear whether this is enforced by the OS or google play services.
edit: Actually I don't even know that the App Store has permission to uninstall apps. If it doesn't, then it can only update apps that are signed with developer keys.
As for backups, apps have control over which data can be backed up. Google cannot access app data if the app doesn't consent to it, assuming the Android OS itself is not somehow compromised.
As it stands if you buy a normal android phone, then you must trust Google.
1. you still need way more parties involved (eg. OEMs, chipset makers), unlike google which probably has acesss 95+% of the non-chinese android phones.
2. backdoors involving the SDK/OS are far less discriminate and therefore has higher risk of detection by third party researchers. (eg. https://www.xda-developers.com/mediatek-su-rootkit-exploit/)
Compare that to if google has the signing keys for updates to whatsapp. Then the national security letter could just state "hey, here is an update to whatsapp, please sign it with the appropriate keys". That is so much harder for Google to refuse.
I have a lot more faith that google would not comply with the first national security letter than with the second.
It seems to me that if one approach is so politically unacceptable as to be quite unlikely, and the other approach is so politically acceptable as to be feasible, that is highly relevant.
In the first scenario, this is just a hypothetical attack google could do if they were evil. In the second scenario this is a realistic attack we need to consider could happen. The difference between "hypothetical" and "realistic" matters quite a bit.
The second case was apparently feasible enough that the FBI thought it was worth trying in open court. I don't think the first case is that dissimilar. And I think there is a decent chance that the NSA/CIA has stronger pressure methods than what the FBI tried in the San-bernedino case.
And if not, it seems quite a bit more feasible for new legislation to be written that could be used to force google to cooperate with malicious update signing. It certainly fits with the theme of recent "we should be allowed to read your messages" legislation attempts. Heck, I think it would be one of the more reasonable ways to implement such legislation.
They really really don't need to touch your APK to get any user or app data. If you don't realize that, you may have been thinking of wrong threat models.
https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_Ref...
By that I mean, would it be possible that 2 different people download the app from the Play store, one of them gets an unmodified version of the app and the other (perhaps based on the user's race, country of origin, etc.) gets an on-the-fly modified version of the app.
The developer - and likely 99+% of all users - would never know or even be able to tell because most copies of the app in existence are 100% what the developer created. But, for a few rare birds, backdoors are aplenty.
Regardless, I'm 100% against this. But, my thinking above is this is possibly far worse than I initially imagined.
Apple calls this approach "app thinning".
Also remember that Google Play Store could serve whichever APK it liked right now - the signing keys aren't surfaced in UI on Android (or iOS for that matter).
Remember, Microsoft got in trouble for just pre installing internet explorer. There was no blockage or anything preventing you from installing any other browser and use it without any limitations.
Upstream can sign or otherwise indicate integrity (e.g., Git revision checksums) of all individual source files. This ... becomes tedious to check, but can be checked against Debian sources to identify where any changes might reside. Note that this still applies only to sources rather than builds, though it's an option. It's likely not an option in wide use.
Debian also ships sources rather than builds, which can be built directly on your own systems (or within your own build-and-distribution network). Debian's had a "reproducible builds" initiative for some years (https://wiki.debian.org/ReproducibleBuilds), and this covers a fair number of packages (I don't have a count offhand), though there are notable exceptions of packages which are simply too complex to build reproducibly. I think the September 2020 summit notes are the best current overview of status, tools, and issues: https://reproducible-builds.org/reports/2020-09/
And, unlike Google Play, it's possible to download from any arbitrary Debian mirror without authentication. Authentication-prior-to-download could lead to branching logic for user-specific modified packages being delivered. Another option of course being for a generically-modified package that targets a single user or specified set of narrow criteria.
With Google the entire process is completely opaque, they do everything behind closed doors, and can hand different users different blobs on demand.
Ultimately with Google, you only have Google's word for what they're doing, and you know they have the capability to provide different versions to different users on demand of an NSL. With Debian, they have no way to attack a specific user, and you fully have the ability to "check their work."
That's blatantly understating how many packages are reproducible.
I am curious what are good solutions to this problem? Compile your OS (and any other software) from source?
And, there are large tech firms doing this already.
In the case of Apple, I agree. It doesn't make sense to use their ecosystem without trusting them fully.
However, in the case of Android / Google Play, right now the developers have the option to choose between APKs and App Bundles. Why take away that choice? If App Bundles are superior, then developers will choose that option freely. (Google Play is already really pushy when recommending to use App Bundles.)
I think this is exactly the bit people don't like. I don't want them to "own" my operating system.
I wonder if internally they either have this ability or this constraint is only required for non Google app developers?
AFAIK, no, it doesn't; the component which has root is part of the operating system image, and the Play Store merely has the permissions to tell that component to silently install or upgrade a package. However, when upgrading a package, that component will only allow the upgrade if the package is signed by the same key as the previous release. This has more than once led to a package no longer being able to be updated, because the developer was not careful enough with backups and lost the private key.
Not if you want customers.
For apps not enrolled in the Play Store signing scheme, the phone actually verifies directly against the publisher's key, that Google now wants to relegate just as an "upload key". I am saddened by Google's efforts to undermine this fundamental OS security feature. The ultimate goal is clearly to kill off any chance of competing app stores, as developers of new apps distributed through Play Store can now actually never access the key that's supposed to show they control the app, no matter what channel it was delivered through (e.g. Play Store vs. F-Droid.. Really bad for new Open Source apps!)
I do know a bit about PKI. And one option might be that the workflow be something like:
Dev signs bundle => Google signs bundle (including dev signature) => User/Client verifies both signatures.
Google are still signing here, but if the dev signature doesn't verify (or isn't present), there's a post-build modification occurring, which is the principle issue raised in the tweet thread.
It seems this is only required for "Android App Bundles", whatever the hell that is, and not apps.
"Android requires that all APKs be digitally signed with a certificate before they are installed on a device or updated. If you use Android App Bundles, you need to sign only your app bundle before you upload it to the Play Console, and Play App Signing takes care of the rest. However, you can also manually sign your app for upload to Google Play and other app stores."
"And, because app bundles defer building and signing APKs to the Google Play Store, you need to opt in to Play App Signing before you upload your app bundle."
https://developer.android.com/distribute/play-policies#Requi...
"Android App Bundle requirement for new apps and games"
"After August 2021, all new apps and games will be required to publish with the Android App Bundle format. New apps and games must use Play Asset Delivery or Play Feature Delivery to deliver assets or features that exceed a download size of 150MB."
That does make kind of sense, because once you hand over your key and the first user installs your app, you need to use the same key or the user wouldn't be able to update the app. Opting out of Google-side app signing would be kind of useless because Google can keep the keys and sign malicious code in your name regardless, unless you're willing to wipe out your entire install base through a new app.
[1] https://developer.android.com/studio/publish/app-signing#opt...
Maybe they can release a tool to create APKs from App Bundles locally (maybe call it, idk, 'bundletool' or something like that). They could also make it so the Google Play Console allows developers to choose between uploading APKs or an App Bundle, and communicating the pros/cons of both methods. That way, a developer (not Google) can choose which option is best for their business and their customers!
Sound good to me at least (although to be fair, I don't have an ulterior motives or bad intentions)
We can have openness and still be thinking of the children. /s
I dare you to close your eyes and install a random free app on the Play Store or Apple App Store. Chances are high you'll download some malware.
There are two possibilities here: Malice or Incompetence. We'll take Hanlon's razor and assume Incompetence, but it is gross incompetence. It is unacceptable.
> It changes from "We guarantee we will distribute your app unmodified" to ... well, I don't know what you are promising, but it's not that.
The closest analogy would be a universe in which UPS insists you delegate the packaging of your product to them. Your product remains unchanged, but it's packaged with UPS's packaging which (for the sake of this example) may come with better assurance guarantees relative to your own packaging of the product you're shipping.
Point being: (edit: assuming no malicious supply chain interference; I'll get to this) the app is unmodified. Even with Google doing the signing.
I don't inherently see anything wrong with this, though I also don't think any physical carriers have tried this. Anyone have any examples? Even from other subdomains within logistics?
---
Edit: with supply chain interference (compromising build pipelines, etc), who signs the app doesn't really matter; the app is still tampered before it gets to Google's marketplace. The trade with Google compelling their own signing infrastructure is that it reduces the risk of compromised keys for individual development shops enabling malicious actors to sign builds on behalf of the developers.
---
Edit 2: Some pretty great answers and counterpoints here, such as FBA and the resulting uptick in counterfeit goods. Unexpected but good food for thought.
The difference is that you used to be able to verify that Google didn’t modify the app. They simply couldn’t make a change while keeping the signature intact.
Now they can, they just say they won’t and expect you to trust their word.
In theory this can be verified by the developer though? Signing an app shouldn't (I haven't checked this in Google's case) change any integrity values for the app code itself, so the developer (though no one else) is still able to ensure Google wouldn't have tampered anything.
But your point makes sense.
Think the worry is google (and perhaps certain US agencies) will use this new requirement to do essentially the same approach with certain apps.
Problem: you have no way to prove it. Nobody can prove it.
That’s what developer signing proves - that is hasn't been modified.
Which to drive it home, if Bob included a signed photo with each of his items I would know if I got the item from Bob or someone else.