New versions of F-Droid need install priority over other updates

When there’s a new version of the F-Droid app itself, this ought to download and install before any other updates are allowed to download. Otherwise, in a situation where a new F-Droid version is fixing a bug that makes it vulnerable to installing malicious software as updates to existing apps, that malicious software has an opening to be installed before the F-Droid app itself is updated to prevent that.

Not really, updating the Client kills it, the rest remain un-updated…

I agree with @strypey
If this is something that can be implemented as taking priority over other updates, when automated, can be useful.

… until you open the newly updated version of the client, and update them. Which seems like the more sensible flow from a security POV, for reasons given.

that malicious software has an opening to be installed before the F-Droid app itself is updated to prevent that.

What exactly is the security concern here? Android pins the APK signer and enforces that update must be signed by the same private key.

So if you have already installed an app, any malicious update must be signed by the same key. That’s the entire security model of Android.

If the signer (may it be F-Droid or the developer) has lost their signing key to an attacker who used it to sign a malicious update, then :shit: is already hitting the fan.

bug that makes it vulnerable to installing malicious software as updates

I don’t think there can be such a “vulnerability” in fdroidclient. Because Android’s fundamental assumption is to pin the signing key. That is something that Android ensures, not fdroidclient.

That means that Android will still allow you to install the malicious update outside of F-Droid. Because the signing key is the same. Whatever fdroidclient does, once the signing key is lost, you can be social engineered into installing a malicious update. If the signing key is lost, Android’s fundamental security assumption is gone.

The only thing that F-Droid can do in such a situation is to pull/remove the malicious update. But this would be an index update that disables the malicious version, not an fdroidclient update. And since any such hypothetical fdroidclient update would come via an index update, the malicious app update can be removed in that very same index update!

until you open the newly updated version of the client

From a UX perspective, if you click “Update all”, it makes more sense to update fdroidclient last. Otherwise the user is confused as to why the app force-closes even though it has not yet updated everything. Sure, the users can go back, open the app switcher, scroll until they find fdroidclient, and re-open it. But it’s not an experience my grandparents would appreciate.

@thore Let’s assume all of this is true (I have no reason to think otherwise). All you’re telling me is that the scenario I’m describing is unlikely. All of which is good. But the change I’m proposing would make it impossible. What harm would be done my making this change, to justify leaving the unlikely but still present risk of vulnerability in place?

@strypey You have yet to answer the above question: what category of vulnerability is this solving by updating 1st than last?

When there are new versions of F-Droid itself, I think it would be a wise precaution to push them separately. So that the app is updated and restarted before downloading and handling updates from other apps.

This might address the valid UX issue raised about the suggestion I made here;

I was going to post it there, but the topic is now locked. Please feel free to reopen that topic and merge this one into it.

You mean aside from the potential exploit I described in the OP?

Reducing avoidable attack surface is a well-established security principle. The onus isn’t on me to prove a practical attack currently exists. If the F-Droid team want to wait for one to be discovered and exploited instead of taking the precaution of removing this attack surface, eg by updating the F-Droid client separately before pushing updates to any other apps, that’s up to them. The risk has been pointed out, and a simple mitigation suggested. That’s all I can do.

Thanks admins for merging the new topic. Can I also suggest changing the topic title to ‘EDIT: Pushing new versions of F-Droid itself separately from other updates’, to reflect the new suggestion? Feel free to delete this comment when you do (or decide not to, as appropriate).

The same “argument” holds the other way, too: all updates for anything potentially close (or open :sweat_smile:) vulns, so they should be prioritized before stopping the workflow via killing the app to update it. That’s actually what I prefer.

Obviously, not only F-Droid can have attack surface, so, to be utterly certain of being protected from any/every/all nebulous theoretical whatevers, it’s absolutely best practice to smash the device thoroughly upon obtaining. /s :winking_face_with_tongue::man_bowing:t5:

Sure, but none of those apps are the app store that’s handling the update process. Surely the security status of all other apps and updates in any OS depends on that of the package manager? Just as the F-Droid client can’t protect against vulnerabilities in the underlying OS. What am I missing here?

How much hassle is it for the app updates process to first check the current version of the client, and if it’s not the latest in the repo, update that first and restart? Then automatically check for updates to other apps.

It’s full :rooster:&:egg: scenario: There’s simply no optimal path if you assume no trust. I mean, to be utterly sure, why aren’t you writing/reviewing every LOC yourself in machine binary, after reviewing the OS/hardware to verify they do what you want @ bare silicon?

For most people, the default is enough. If you want different, code up the PR for a pref & submit to your favorite client for consideration, fork (risky for the tinfoil: I emphathize!) &/| code up your own. FLOSS is here for :index_pointing_at_the_viewer:t5:!

To be honest i don’t think this change would mean much but also wouldn’t be entirely meaningless either.

It genuinely does make sense for some things to have higher priority updates than others especially if the thing in question is security sensitive. And i mean i would consider an app store/repo security sensitive.

A bit off topic and not the same argument but.

This is actually why i don’t get my web browsers in particular from F-Droid. Cause while i like F-Droid’s concept of building everything from the source this has also lead to some longer than preferred delays of updates. And while i believe this can be tolerated for most apps. For something as security sensitive as a Web Browser i am good. Of course that’s not to say you are making a bad decision by using something like Fennec perse that’s not at all what i am saying. Im just saying per my preferences and threat model it’s not something i’m personally willing to risk.

So while i think it would be an improvement i also think the gain would be a bit more on the negligible side of things as the Android security model already defends against most theoretical issues paired with the mitigations F-Droid attempts to enforce server side. That said the real risk is more on the server than with the app. The app is pretty solid security wise nowadays. Not to say there isn’t room for improvement but it is acceptable. All is to say i don’t think this meaningfully reduces risk but at the same time i don’t think it’s a bad idea either. I’d say it’s more so on the positive side. Also hypothetical vulnerability windows aside it would allow the software to get enhancements quicker which again. When it comes to critical software is very ideal.

Also for what it’s worth i just turn auto updates off for reasons like this. I can decide when and what software i update first in a specific order at a specific time. I feel this helps mostly (but not completely) mitigate both sides of the issue as i can control what gets applied and when.

No doubt. If I thought it was a steaming mess of security holes, I wouldn’t use it :wink: But it’s maintained by humans, and humans are faliable. 0Days are discovered even in the Linux kernel from time to time, which is arguably one of the most secure pieces of software maintained on the planet. It has to be, because the security of every piece of code that runs on top of it inherits its security state.

Good security is not about hard binaries; secure vs. insecure. It’s about managing risk. Reducing theoretical attack surface whenever there isn’t an overwhelmingly good reason not to, just in case.

Eg Isolating components as much as possible, so a bug that inadvertently creates a security hole in one component can’t affect all the others as easily. The UNIX philosophy of ‘many things, loosely joined’ is mainly about flexibility and code re-usability. But if things are only loosely joined they’re also less likely to be about to cause stability or security problems in each other.

(FWIW I prefer ‘library’ to ‘store’, for the same reason I prefer ‘proprietary’ to ‘nonfree’ or ‘closed source’, but you do you :blush:)

Exactly. Especially because (as I said), the security of every app the F-Droid library app installs or updates, becomes a subset of the security state of the library app at the time of installation or last update. This is unavoidable, so it just seems like a no-brainer to me to give the library app update priority, just in case. So the security state inherited by the other apps updated is the best it can conceivably be.

I may have mentioned this, but the UX issue can be solved by always checking for a new library app version at the beginning of every update process, and if one is found, applying that before checking for any other updates.

@strypey but if the current app version’s compromised such that a new secure version’s available to fix it, why would 1 trust current enough to find/dl/install a supposedly secure update?! I might as well trust said current version to update everything else 1st, then update the client for smooth workflow XOR delete the current client outright (noting that there’s no backup/restore capability currently) & download new secure from known-good source via some known-good client/browser/&c via known-good OS via known-good firmware via known-good hardware.

You logically can’t have it both ways simultaneously.

I agree with “at the time of installation”, but disagree with “[at the time of] last update”.

Again, Android pins the APK signer upon first install of an app. This means that:

  • If fdroidclient is compromised, it can only successfully update to APKs that are signed with the same key (and higher versionCode).
  • Therefore, an attacker needs to also compromise either the developer or F-Droid’s offline signing server (depending on who signed the app).
  • But if the attacker can compromise the APK signer, they don’t need to compromise fdroidclient at all! Because fdroidclient (and Android) will happily install any validly signed APK from the same signer.

As a user, you place a lot more trust into the APK signer than into the repo signer. Yes, a malicious repo signer can give you a bad APK, but only at first install. For every update afterwards, an attacker needs to compromise the APK signer. That’s why developer-signed, reproducibly-built APKs are preferred nowadays.

So if you click “Update all”: For security, the order doesn’t matter, only the APK signer matters. For UX, it’s much nicer if fdroidclient doesn’t immediately force-close into your face.

I think this is not fully true, if you have installed an app through Fdroid (or any other store), then by default, only the source of the install can update it and it requires additionla confirmation to update from a different source.

This should be more clear in the UI and there should be a list for each app of other apps that can update it, in which you then also can remove them.