require user presence on security key signatures - #11
Open
plotnick wants to merge 1 commit into
Open
Conversation
A security key signature carries a short trailer of a flags byte and a
signature counter. The authenticator folds both into the signed data,
so a verifier can trust them. Bit 0 of the flags records user
presence, the authenticator's assertion that somebody touched the key.
We were verifying sk signatures without looking at the flags. A
signature produced without a touch, whether by a key enrolled with
no-touch-required or by a purely software authenticator, was therefore
accepted. Refuse those by default, as sshd does. Verifiers that
deliberately accept no-touch enrollments can relax the check per
verification with require_user_presence(false).
The new tests emulate an authenticator in software, which is the only
way to produce a signature without user presence set. They check that
a touched signature verifies end to end, and that an untouched one is
refused by default but accepted under the opt-out. That acceptance
shows the refusal comes from the flags rather than from a bad
signature. An ignored test runs the same verification against a real
key in the SSH agent:
SSHAUTH_TEST_SK_KEY=<comment or SHA256 fingerprint> \
cargo test -- --ignored sk_hardware
The signature counter remains unused. Authenticators without a
counter legitimately report zero, so the only meaningful check would
be per-key monotonicity, which needs state the verifier does not have.
Co-Authored-By: Claude Mythos 5 <noreply@anthropic.com>
plotnick
force-pushed
the
sk-user-presence
branch
from
August 31, 2026 13:50
a0aa80e to
d5c0319
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A security key signature carries a short trailer of a flags byte and a signature counter. The authenticator folds both into the signed data, so a verifier can trust them. Bit 0 of the flags records user presence, the authenticator's assertion that somebody touched the key.
#8 verified sk signatures without looking at the flags. A signature produced without a touch, whether by a key enrolled with no-touch-required or by a purely software authenticator, was therefore accepted. Refuse those by default, as sshd does. Verifiers that deliberately accept no-touch enrollments can relax the check per verification with
require_user_presence(false).The new tests emulate an authenticator in software, which is the only way to produce a signature without user presence set. They check that a touched signature verifies end to end, and that an untouched one is refused by default but accepted under the opt-out. That acceptance shows the refusal comes from the flags rather than from a bad signature. An ignored test runs the same verification against a real key in the SSH agent:
The signature counter remains unused. Authenticators without a counter legitimately report zero, so the only meaningful check would be per-key monotonicity, which needs state the verifier does not have.
🤖 Disclaimer: LLM assistance was used to find this issue and prepare this patch, but human 👀 and 🧠 reviewed it.