A signature made after its key expired, or before the key was made, is accepted #209

Open
opened 2026-10-13 19:22:31 +02:00 by clawbot · 1 comment
Collaborator

verifySignature in mfer/openpgp.go accepts ErrKeyExpired from the OpenPGP library so that a manifest outlives its key, but never asks when the signature was made. So it accepts signatures no valid key could have made. Confirmed on next by the review of #201 (#201 (comment)):

  • a signature dated after its key expired;
  • a signature from a key whose self-signature, or from a signing subkey whose binding signature, expired before the signature was made, once the key or subkey has expired as well;
  • a signature dated before its key was made, including when the key's creation date is still in the future.

Key expiry is what limits the damage of an old key that leaks; as it stands, whoever holds an expired key can still sign manifests that check --require-signature accepts.

Severity: major.

Correct: an expired key is tolerated only for a signature made while the key, and the subkey that made it, were valid: dated no earlier than the key's creation, before its expiry, under self-signatures and binding signatures that had not expired then. In docs/FORMAT.md terms: one good, unexpired signature, made while its key was valid, by a key that may have expired since.

Definition of done

  • Failing tests first, with keys and signatures made by the OpenPGP library the code uses and a fixed clock: each of the three cases above is refused; a signature made while its key was valid, by a key that has expired since, still verifies (TestVerifySignatureKeyExpiredSince).
  • The fix in verifySignature in mfer/openpgp.go.
  • The Signature Scheme section of docs/FORMAT.md states the rule.
  • make check passes.

Model: opus-5-5

`verifySignature` in `mfer/openpgp.go` accepts `ErrKeyExpired` from the OpenPGP library so that a manifest outlives its key, but never asks when the signature was made. So it accepts signatures no valid key could have made. Confirmed on `next` by the review of https://git.eeqj.de/sneak/mfer/pulls/201 (https://git.eeqj.de/sneak/mfer/pulls/201#issuecomment-137063): - a signature dated after its key expired; - a signature from a key whose self-signature, or from a signing subkey whose binding signature, expired before the signature was made, once the key or subkey has expired as well; - a signature dated before its key was made, including when the key's creation date is still in the future. Key expiry is what limits the damage of an old key that leaks; as it stands, whoever holds an expired key can still sign manifests that `check --require-signature` accepts. Severity: major. Correct: an expired key is tolerated only for a signature made while the key, and the subkey that made it, were valid: dated no earlier than the key's creation, before its expiry, under self-signatures and binding signatures that had not expired then. In `docs/FORMAT.md` terms: one good, unexpired signature, made while its key was valid, by a key that may have expired since. ## Definition of done - Failing tests first, with keys and signatures made by the OpenPGP library the code uses and a fixed clock: each of the three cases above is refused; a signature made while its key was valid, by a key that has expired since, still verifies (`TestVerifySignatureKeyExpiredSince`). - The fix in `verifySignature` in `mfer/openpgp.go`. - The Signature Scheme section of `docs/FORMAT.md` states the rule. - `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-13 19:22:31 +02:00
Author
Collaborator

Fixed in #213: verifySignature now also verifies as of the signature's creation time and refuses the signature if its key or subkey was not valid then. docs/FORMAT.md states the rule.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/mfer/pulls/213: `verifySignature` now also verifies as of the signature's creation time and refuses the signature if its key or subkey was not valid then. `docs/FORMAT.md` states the rule. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/mfer#209