-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify ".digest_md5" and ".sig_key" sections #29
Comments
Can you please describe it in words that can be added to AppImageSpec? Every other aspect of the format is described in the spec. Also, I don't quite remember the reason for this. Is the following halfway correct?
If it is correct until here,
|
The use case for AppImageLauncher is to be able to properly differentiate between AppImages. Many people don't version their AppImages. By embedding something that is veeeeery likely unique, we can tell them apart. You guessed the reason why a hash over an entire file cannot be embedded within that file. The |
By looking at it seems to me like for the generation of the digest, the ELF sections
are skipped. Questions:
|
Please don't change your post too often. I provide quotes of the current question I'm answering to provide the original context.
MD5 is not "insecure" per se, only when used in security relevant contexts. We just use it for some collision detection or other uses where you'd like to identify an AppImage in a better way than just by its filename. There's no reason not to use MD5, but a lot reasons to actually do so. It's much less complex than SHA-2, and can be calculated faster, saving runtime.
I never touched this
See above.
There hadn't been gone too much thought into signature validation before changes were made in ... 2017, I think? This feature hasn't been used before AppImageUpdate has first implemented some features which make heavy use of signatures. There, a lot of problems were discovered. I think a lot of the discussion can be found in issues over at the AppImageUpdate repository. But let me provide a brief summary. What we had embedded before this section was just a signature. To verify a signature, you need not only the signature, but also the (public) key. The signature doesn't contain information what key has been used. Even if it did, there had been a classic distribution problem: where to get the key from? You cannot assume every key is available from the usual keyservers, nor do you want to rely on the availability of these servers (read: shall also work offline). What to do to fix the issue? Well, it's as simple as embedding the public portion of the key which signed an AppImage into the AppImage. That way, the public key is always available for signature verification. I hope you now understand why making this a file in the AppDir is a pointless idea. That'd render the signature useless again, as you'd have to have a second file in order to be able to make any checks about it. This is not the goal of an AppImage.
Dunno what
It's been in for more than 2 years. Since most of it has been created for AppImageUpdate, you should check that issue tracker. Why are you asking all these questions now? I'm kinda curious. Nobody's noticed these things haven't been documented properly in over two years after all. |
I don't understand this: When the public key would be inside the AppImage filesystem rather than in an ELF section, why couldn't the tool that verifies the signature extract it from there?
It worked and was feature complete, until the changes discussed above apparently broke it.
Can we agree that this section may, and should, be skipped for the reasons you wrote above? If we don't skip that section, then it is not needed anymore - then we could put the updateinformation into the filesystem image because then it would also be impossible to change. It was a design goal for the updateinformation to be changeable "after the fact".
Doesn't matter. I didn't have time to look at that stuff or didn't notice that the file format was changed/amended in undocumented ways that are not in the spec.
Lack of time. I am doing an experimental implementation of the AppImage tools in Go and therefore I now am asking myself whether I have to implement this stuff that is not (yet?) specified. I need functionality like |
Well, that requires any tool that is supposed to validate an AppImage to implement the AppImage filesystem in order to be able to open it without running it itself. Which is a waste of time and code, and also less secure. There is no reason not to make this a section, but again there's many to do so (faster and easier to extract, way less complex, no need for any external libraries).
There's no reason to not make it a section. Again, easier to extract, less complex, faster to extract. However, there's no real reason not to sign that information. For How is that impossible to be changed? You can alter an AppImage filesystem. You can even make a new one, and then concat it to the original executable header. It's an order of calculation thing, where every already-known information has to be included to make sure it can't be tampered with. If your signature calculation is done on the entire AppImage (skipping only ELF sections that must be skipped because they're calculated later on), there's no difference. Please don't mix things up. A brief introduction in how and why to calculate information that is embedded into the AppImage executable headerRule of thumb: When calculating a piece of information that is embedded into the AppImage, this calculation can and should involve anything that is already embedded, except for itself and what will be embedded later on.
|
I need a way to change the contents of Use case: I have a server with 1,000 AppImage files. Now my domain name changes and I don't want to re-create all of the AppImages. OK, now that I think about it, one could say "just change
The same argument could easily be made especially for at least
For 2. we are already calculating a digest. It is what gets signed. Now, can't we use that signature as the hash for collision detection purposes? Then we would not need steps 4. and 5. Ah right, what about unsigned AppImages, those don't have a signature that we could use for collission detection purposes. Solution is easy: Not only embed the Signature in the .sha256_sig section, but also the SHA256 digest that the signature signed. We can calculate that SHA256 digest also when the AppImage is not signed. You may say that changing the mechanism now this breaks already-signed AppImages. Not necessarily, because AppImageUpdate could be changed with minor effort to take the possibility that there may (not must) now be a SHA256 digest in the |
As it stands now, Rationale:
That non-spec conforming implementations have been out in the wild for so long is not valid rationale to put something into a spec. |
Fact: TheAssassin's implementation of the signature checking only zeros According to https://travis-ci.org/AppImage/AppImageKit/jobs/616099634#L3374 the SHA256 digest is claimed to be: According to https://travis-ci.org/AppImage/AppImageKit/jobs/616099634#L3484 the download URL is So let's verify it:
|
Specify
.digest_md5
section@TheAssassin I am not 100% sure anymore what it is and why we have it - can you help me?
The text was updated successfully, but these errors were encountered: