{"thread":{"id":"66487","subject":"ssh signing: valid-before is checked at the signer's own date, and a missing revocationFile fails open","startedAt":"2026-10-08T06:56:22Z","lastAt":"2026-10-08T13:42:42Z","messageCount":2,"participants":["Christian Noé Ramos López","Phillip Wood"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"554445","messageId":"CAHGSfbZ_Q8Ujt3om0POapkjWZed1pZVUrB-mV-e+UjmPgCNvWQ@mail.gmail.com","threadId":"66487","inReplyTo":null,"subject":"ssh signing: valid-before is checked at the signer's own date, and a missing revocationFile fails open","fromName":"Christian Noé Ramos López","fromEmail":"chris@nortesoftware.dev","sentAt":"2026-10-08T06:56:22Z","receivedAt":"2026-10-08T06:56:22Z","isPatch":false,"sender":{"key":"chris@nortesoftware.dev","avatar":null},"body":"Two things that, together, mean an SSH signing key cannot be reliably\nstopped from being trusted. git 2.47.3, OpenSSH 10.0p2, Debian 13;\nsource read at v2.47.3 and at master (c46c1e37724f).\n\n1. valid-before is checked at a date the signer writes.\n\nSSH signatures carry no time of their own, so git passes -Overify-time\nfrom the committer or tagger line (gpg-interface.c,\nparse_payload_metadata). alice's key is in the allowed signers file\nwith valid-before=\"20260101\":\n\n    ssh-old        %G?=G 2025-06-01 12:00:00 +0000 verify-commit=0 merge=0\n    ssh-backdated  %G?=G 2025-06-01 12:00:00 +0000 verify-commit=0 merge=0\n    ssh-honest     %G?=U 2026-10-08 02:15:15 -0400 verify-commit=1 merge=128\n\nssh-backdated was signed today, with only the committer and author\ndates set to 2025-06-01. Nothing distinguishes it from ssh-old except\nwhen it was made, which only its author knows. ssh-honest, signed and\ndated today, is refused: \"key has expired: verify time ... >\nvalid-before 2026-01-01T00:00:00\".\n\nThe GPG backend refuses both:\n\n    gpg-old        %G?=Y verify-commit=1 merge=128\n    gpg-backdated  %G?=Y verify-commit=1 merge=128\n\nThe documentation for gpg.ssh.allowedSignersFile says \"Git will mark\nsignatures as valid if the signing key was valid at the time of the\nsignature's creation\", which is the intent, but does not say the time\ncomes from the commit. So valid-before rotates a key; it does not\nretire one.\n\n2. A configured revocation file that does not exist fails open.\n\ngpg-interface.c:568-574 at v2.47.3 (579-586 at master): if the\nrevocation file exists, pass -r; otherwise warn and verify without it.\nThe same file, present and listing alice's key, refuses:\n\n    S2-revoked       %G?=B verify-commit=1 merged=no\n    S3-revfile-gone  %G?=G verify-commit=0 merged=yes\n                     warning: ssh signing revocation file configured\nbut not found\n\nS3 merged under `git merge --ff-only --verify-signatures`. An\nunreadable file and a directory both fail closed:\n\n    S4-revfile-0000  %G?=B verify-commit=1 merged=no\n    S6-revfile-dir   %G?=B verify-commit=1 merged=no\n\nssh-keygen, given the same missing path, refuses: exit 255, \"Could not\nverify signature\". git avoids that by not passing -r. OpenSSH's\nRevokedKeys says, in sshd_config(5), \"Note that if this file is not\nreadable, then public key authentication will be refused for all\nusers.\"\n\nNo test in git exercises gpg.ssh.revocationFile; it appears only in\nDocumentation/config/gpg.adoc and gpg-interface.c.\n\nControls for both runs, fixed beforehand: a good signature gives G and\nmerges; an unsigned commit gives N and is refused; the revocation file\npresent and listing the key gives B and is refused; a commit with its\nmessage changed and the signature kept gives B and is refused.\n\nTogether: the two ways to stop trusting an SSH signing key are\nvalid-before, which the signer can date around, and revocationFile,\nwhich does nothing if its path is wrong. Either would be enough on its\nown if it held.\n\nWhat I would ask for: refuse when the revocation file is configured and\nmissing, as ssh-keygen and sshd do, or say in the documentation that it\nis ignored; and say, under valid-before, where the time compared\nagainst it comes from.\n\nOn prior art: the ssh signing series (Fabian Stelzer, 2021) carried the\nwarning from before v4, and the review raised the config name's case,\nnot what a missing file should do. The key-lifetime series (RFC\n2021-10-15 to v6 2021-12-09) passes the commit date to the check, and\nthe replies are about style. The N for an unconfigured allowed signers\nfile is already on the list (Grayson Tinker, 2026-06-25) and is not\npart of this.\n\nChristian Ramos\nNorte Software\nchris@nortesoftware.dev\n\n"},{"id":"554500","messageId":"ec4de165-c7d1-43d9-979b-08c1cb67022d@gmail.com","threadId":"66487","inReplyTo":"CAHGSfbZ_Q8Ujt3om0POapkjWZed1pZVUrB-mV-e+UjmPgCNvWQ@mail.gmail.com","subject":"Re: ssh signing: valid-before is checked at the signer's own date, and a missing revocationFile fails open","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-08T13:42:42Z","receivedAt":"2026-10-08T13:42:42Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Christian\n\nHaving waded through this here is a human readable summary:\n\n(1) Our documentation implies that we check the expiry date of the key (which is recorded in the allowed signers file) against the date the commit was signed, but we actually use the committer date which can easily be faked.\n\n(2) If the revocation file does not exist we print a warning rather than failing the operation like the gpg backend does.\n\nFor (1) I'd be happy to see a patch that tightens the wording, but we should also note that the timestamp in the gpg signature can also be faked.\n\nFor (2) I agree failing seems like the safer option.\n\nThanks\n\nPhillip\n\nOn 08/10/2026 07:56, Christian Noé Ramos López wrote:\n> Two things that, together, mean an SSH signing key cannot be reliably\n> stopped from being trusted. git 2.47.3, OpenSSH 10.0p2, Debian 13;\n> source read at v2.47.3 and at master (c46c1e37724f).\n> > 1. valid-before is checked at a date the signer writes.\n> > SSH signatures carry no time of their own, so git passes -Overify-time\n> from the committer or tagger line (gpg-interface.c,\n> parse_payload_metadata). alice's key is in the allowed signers file\n> with valid-before=\"20260101\":\n> >      ssh-old        %G?=G 2025-06-01 12:00:00 +0000 verify-commit=0 merge=0\n>      ssh-backdated  %G?=G 2025-06-01 12:00:00 +0000 verify-commit=0 merge=0\n>      ssh-honest     %G?=U 2026-10-08 02:15:15 -0400 verify-commit=1 merge=128\n> > ssh-backdated was signed today, with only the committer and author\n> dates set to 2025-06-01. Nothing distinguishes it from ssh-old except\n> when it was made, which only its author knows. ssh-honest, signed and\n> dated today, is refused: \"key has expired: verify time ... >\n> valid-before 2026-01-01T00:00:00\".\n> > The GPG backend refuses both:\n> >      gpg-old        %G?=Y verify-commit=1 merge=128\n>      gpg-backdated  %G?=Y verify-commit=1 merge=128\n> > The documentation for gpg.ssh.allowedSignersFile says \"Git will mark\n> signatures as valid if the signing key was valid at the time of the\n> signature's creation\", which is the intent, but does not say the time\n> comes from the commit. So valid-before rotates a key; it does not\n> retire one.\n> > 2. A configured revocation file that does not exist fails open.\n> > gpg-interface.c:568-574 at v2.47.3 (579-586 at master): if the\n> revocation file exists, pass -r; otherwise warn and verify without it.\n> The same file, present and listing alice's key, refuses:\n> >      S2-revoked       %G?=B verify-commit=1 merged=no\n>      S3-revfile-gone  %G?=G verify-commit=0 merged=yes\n>                       warning: ssh signing revocation file configured\n> but not found\n> > S3 merged under `git merge --ff-only --verify-signatures`. An\n> unreadable file and a directory both fail closed:\n> >      S4-revfile-0000  %G?=B verify-commit=1 merged=no\n>      S6-revfile-dir   %G?=B verify-commit=1 merged=no\n> > ssh-keygen, given the same missing path, refuses: exit 255, \"Could not\n> verify signature\". git avoids that by not passing -r. OpenSSH's\n> RevokedKeys says, in sshd_config(5), \"Note that if this file is not\n> readable, then public key authentication will be refused for all\n> users.\"\n> > No test in git exercises gpg.ssh.revocationFile; it appears only in\n> Documentation/config/gpg.adoc and gpg-interface.c.\n> > Controls for both runs, fixed beforehand: a good signature gives G and\n> merges; an unsigned commit gives N and is refused; the revocation file\n> present and listing the key gives B and is refused; a commit with its\n> message changed and the signature kept gives B and is refused.\n> > Together: the two ways to stop trusting an SSH signing key are\n> valid-before, which the signer can date around, and revocationFile,\n> which does nothing if its path is wrong. Either would be enough on its\n> own if it held.\n> > What I would ask for: refuse when the revocation file is configured and\n> missing, as ssh-keygen and sshd do, or say in the documentation that it\n> is ignored; and say, under valid-before, where the time compared\n> against it comes from.\n> > On prior art: the ssh signing series (Fabian Stelzer, 2021) carried the\n> warning from before v4, and the review raised the config name's case,\n> not what a missing file should do. The key-lifetime series (RFC\n> 2021-10-15 to v6 2021-12-09) passes the commit date to the check, and\n> the replies are about style. The N for an unconfigured allowed signers\n> file is already on the list (Grayson Tinker, 2026-06-25) and is not\n> part of this.\n> > Christian Ramos\n> Norte Software\n> chris@nortesoftware.dev\n\n\n"}]}