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

[feature] harden verification #487

Open
laurentsimon opened this issue Feb 16, 2023 · 3 comments
Open

[feature] harden verification #487

laurentsimon opened this issue Feb 16, 2023 · 3 comments
Labels
area:gha Issues with the gha verifier area:hardening Issue related to security hardening type:feature New feature request

Comments

@laurentsimon
Copy link
Contributor

laurentsimon commented Feb 16, 2023

we currently don't verify the cert in the bundle is the same as the one in the rekor entry, we only verify the signatures are the same https://github.com/slsa-framework/slsa-verifier/blob/main/verifiers/internal/gha/bundle.go#L175-L183

We should probably verify the certs match as well.

NOTE: apprently cosign does not perform this verification either

@ianlewis ianlewis added type:feature New feature request area:hardening Issue related to security hardening area:gha Issues with the gha verifier labels Feb 21, 2023
@ianlewis
Copy link
Member

ianlewis commented May 10, 2023

Is there a real possibility that the two signatures would be exactly the same but that multiple certificates would be able to verify it? I suppose that there aren't necessarily any cryptographic guarantees but I wonder if this is actually exploitable in practice.

I would think that would be pretty problematic since it would imply that the multiple public keys (including some completely different, potentially attacker-controlled key) would be able to pass signature verification.

@asraa
Copy link
Contributor

asraa commented May 10, 2023

Yes, technically the signatures matching is the only requirement - although this is a "SHOULD" as an extra robustness pass. Verifying the sigs match implicitly verifies the public key of the cert, since, except at very statistically improbable events, no two pks should give the same sigs on the same given message (the attestation).

It is possible the cert content may be different with the public key the same, and that's indicating a key compromise during the 10 min window where the Fulcio cert is valid (which we cannot protect against) or Fulcio misbehavior.

@laurentsimon
Copy link
Contributor Author

laurentsimon commented May 10, 2023

Verifying the sigs match implicitly verifies the public key of the cert, since, except at very statistically improbable events, no two pks should give the same sigs on the same given message (the attestation).

I don't think that's necessarily true. It's not a property of signature schemes, in particular if an attacker can select the public key. With ECDSA for example, it's easy to compute signature collision; I think it's just a matter of re-arranging the equation with the pubKey as the unknown variable and solving it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:gha Issues with the gha verifier area:hardening Issue related to security hardening type:feature New feature request
Projects
None yet
Development

No branches or pull requests

3 participants