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

Perform DSA signature verification in SparkleUpdateInfoProvider #200

Open
groob opened this issue May 6, 2017 · 4 comments
Open

Perform DSA signature verification in SparkleUpdateInfoProvider #200

groob opened this issue May 6, 2017 · 4 comments

Comments

@groob
Copy link

groob commented May 6, 2017

Recently, the Handbrake download was compromised to distribute a version of known malware.

Would it be possible for AutoPKG to check for the known, bad version of this software or is this out of scope?

Edit: the download was fixed, so this issue is more of a FYI for anyone that updated handbrake recently.

@gregneagle
Copy link
Contributor

gregneagle commented May 6, 2017 via email

@macmule
Copy link
Member

macmule commented May 6, 2017

Hi folks,

So, I wonder if we could add a DSA signature check somehow to the Sparkle processor?

With Sparkle, you can sign an update. Within the AppCast.xml there is the DSA, as per:

sparkle:dsaSignature="MCwCFHIJEtiUSy0wRy5TjzXQmvYOTdDvAhQROkC8f7z+qF5FaY18aY3wWDPjFg=="

An app bundles info.plist should give details to the name of it's public key name, which is round in the /Resources folder within the app bundle:

<key>SUPublicDSAKeyFile</key>
<string>dsa_pub.pem</string>

FWIW, these examples were taken from AutoCasperNBI.. but Handbrake has the same.

@macmule
Copy link
Member

macmule commented May 6, 2017

if the DSA sig can be calculated via AutoPkg, I can test creating an app & invalidating the DSA

@timsutton
Copy link
Member

I remember looking at this possibility when first working on the SparkleUpdateInfoProvider, and it was before there was already an established pattern of using the CodeSignatureVerifier processor as part of a download step. Now that this is commonplace, it seems reasonable to mount a DMG or read a file from an app's resources bundle.

It seems reasonable to me that if the code to do the signature verification could be done using no additional Python dependencies and work on all supported versions of macOS, then this could be worth doing as yet another validation of the download.

One way to implement this would be to implement the same verification code that Sparkle does (using CommonCrypto and PyObjC), or perhaps even better would be to use the pyobjc library support for dynamically adding your own bridgesupport metadata and actually load the Sparkle framework included with the app. The advantage is that you avoid re-implementing the verification code, and the disadvantage is trading one instability for another - relying on a method provided by the Sparkle framework whose signature may change subtly in different versions. Either way there are some concerns here to make it so that this works consistently across different OS versions and/or bundled Sparkle frameworks.

@timsutton timsutton changed the title compromised version of Handbrake download Perform DSA signature verification in SparkleUpdateInfoProvider May 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants