You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flatpak can falsely think a deploy is a downgrade when a remote's collection ID changes. #1477
Even when collection IDs are used, flatpak stores refs in refs/remotes not refs/mirrors. This can lead to problems when a remote's collection ID changes (which happens for example in Endless with eos-stage-flatpak which switches from production to staging or vice versa).
Let's say I have a remote called appserver that provides a ref called app, with the collection ID com.appserver.Staging or com.appserver.Prod depending on which repo is used. If I have the (com.appserver.Staging, app) installed which has timestamp A and I switch the remote to prod and try to update to (com.appserver.Prod, app) which has timestamp B, and A is newer than B, flatpak will think the operation is a downgrade, which is not the case.
This isn't very different from how it works without collection IDs (the timestamp of the existing ref is checked as long as the remote name matches regardless of whether the URL matches)
@rshuler pointed out that in many cases this behavior is reasonable because you usually want to update to a newer commit even when you're switching from dev to prod or vice versa
For P2P code the ostree-metadata ref becomes important, and in that case you do want to "downgrade" because really it's an entirely different ref. For this reason, I'm considering if flatpak should be doing more mirror pulls which would avoid this. The only case where this would make a downgrade attack possible (that is, a peer maliciously serving you an old ref) is if you (a) don't have any version or an old version of that ref by default and (b) only have access to malicious sources (peers), which is only very slightly worse than the status quo (because you're more likely to start out with someostree-metadata than both the staging and prod versions).
Activity
mwleeds commentedon Mar 12, 2018
A few more thoughts:
ostree-metadataref becomes important, and in that case you do want to "downgrade" because really it's an entirely different ref. For this reason, I'm considering if flatpak should be doing more mirror pulls which would avoid this. The only case where this would make a downgrade attack possible (that is, a peer maliciously serving you an old ref) is if you (a) don't have any version or an old version of that ref by default and (b) only have access to malicious sources (peers), which is only very slightly worse than the status quo (because you're more likely to start out with someostree-metadatathan both the staging and prod versions).mwleeds commentedon Apr 30, 2018
The
ostree-metadatacase is handled by endlessm/eos-meta@d3f61ccMake finding related refs tolerant of missing remotes
Make finding related refs tolerant of missing remotes
Make finding related refs tolerant of missing remotes