Skip to content
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

Verify integrity by hash if served by HTTPS, not by signature #1579

Closed
GamePad64 opened this issue Apr 30, 2020 · 4 comments
Closed

Verify integrity by hash if served by HTTPS, not by signature #1579

GamePad64 opened this issue Apr 30, 2020 · 4 comments
Labels
1.x Sparkle 1.x

Comments

@GamePad64
Copy link

Appcast is secure and unmalleable by definition, if served using HTTPS. So, we need to only protect enclosures. The simplest and robust solution is to use plain-old hashes.

Advantages:

  • we do not need to store secret somewhere secure
  • there is no chance to lose the private key
  • verification can be performed without public key
  • hash is reproducible, so hash(binary) yields the same result every time

Proposed syntax:

<enclosure sparkle:integrity="sha256-base64_encoded_hash">

This attribute has the same semantics, as Subresource Integrity in HTML, which is widely used for the same purpose, as signature in Sparkle, but implemented in more streamlined way.

Also, SHA2 algorithm family is CPU-accelerated, so the computation is easier, even on very old machines, also being more energy-efficient.

@GamePad64 GamePad64 added the 1.x Sparkle 1.x label Apr 30, 2020
@kornelski
Copy link
Member

kornelski commented Apr 30, 2020

There have been cases where application authors had their web servers hacked, but not their private machines. In these cases Sparkle's signatures have proven to be beneficial and prevented automatic spread of malware. I think that's important.

There have been proposals to sign appcasts themselves. #971 If appcasts were signed, then checksum in the appcast would suffice. Otherwise I'm afraid subresource integrity would not be sufficient against appcast replacement hacks. HTTPS protects transit, but not data at rest.

@GamePad64
Copy link
Author

The case of hacked web servers is valid, but the code is already signed using Apple Code Signing, so the malware will have invalid signature anyway, so the user machine is already protected by Gatekeeper.
A more realistic case is transmission or i/o error, leading to bit errors in update packages, and hashsums work perfectly well here.

@kornelski
Copy link
Member

HTTPS already prevents transmission errors. Apple Code Signing checks integrity too.

@zorgiepoo
Copy link
Member

Appcasts are not generally trusted by Sparkle, servers can be hacked, app bundle code signing checks are not done with 100% integrity, so EdDSA is still needed, and signing appcasts in future might be nice (optional) future improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x Sparkle 1.x
Projects
None yet
Development

No branches or pull requests

3 participants