Resident SK keys lose verify-required on download

Savely Krasovsky savely at krasovs.ky
Fri Dec 4 04:32:34 AEDT 2026


Hi,

I'm following up on PR #701, which I submitted on 25 July:
https://github.com/openssh/openssh-portable/pull/701

The patch has now been open for over four months, and I haven't yet received maintainer feedback on the proposed fix. Could someone review it for inclusion and let me know if there are any blockers?

To recap, ssh-keygen -K and ssh-add -K can lose SSH_SK_USER_VERIFICATION_REQD when loading resident credentials from authenticators with built-in UV, even though the credential has credProtect=UV_REQUIRED. In my Token2 Bio3 testing, the downloaded key failed with "device not found"; restoring the flag allowed UV and signing to succeed.

The patch derives the flag from the credential's credProtect policy, independently of the device's UV capability, and retains compatibility with older libfido2 versions through HAVE_FIDO_CRED_PROT. Its scope is limited to reconstructing resident-key flags; the broader discussion about PIN versus internal-UV selection can be addressed separately.

The PR documents hardware tests for both UV_REQUIRED and UV_OPTIONAL_WITH_ID credentials, as well as successful signing after downloading a newly enrolled verify-required key. Token2 also confirmed the issue on this list on 11 August and offered test hardware or further verification.

If changes or additional tests are needed, please let me know the specific requirements so I can address them. Otherwise, could this be picked up for an upcoming release? I'm happy to rebase or resend the patch in the preferred format.

Best regards,
Savely Krasovsky

On 2026-08-04T04:23:01+02:00, openssh-unix-dev wrote:
> Humbly asking someone to review: I personally think this change is 
> straightforward, and this check is just unnecessary. I also updated the 
> PR description to address the questions. Hopefully, it's clear what I 
> am doing now.
>
> Сб, 25.07.2026 в 21:20 Savely Krasovsky писал(а):
>> To clarify, in my case this does not reach the PIN fallback. With flags 
>> 0x21, OpenSSH fails with device not found, apparently because it probes 
>> for the UV_REQUIRED credential without requesting UV. Changing the same 
>> key to 0x25 makes OpenSSH find the authenticator, perform UV, and sign 
>> successfully.
>>
>> Сб, 25.07.2026 в 20:59 Savely Krasovsky via openssh-unix-dev писал(а):
>>> Yes, UV_REQUIRED is enforced by both Token2 and YubiKey. The issue is 
>>> not enforcement but that losing the OpenSSH UV flag prevents built-in 
>>> UV from being explicitly requested, causing failure or PIN fallback. 
>>> Manually changing the downloaded key flags from 0x21 to 0x25 fixes it.
>>>
>>> I wrote a workaround for this a year ago: 
>>> https://github.com/savely-krasovsky/ssh-sk-rk-patcher. However, 
>>> installing it on every new machine is not convenient as you can 
>>> imagine, and ssh-add -K has the same problem but keeps the 
>>> reconstructed key only in memory.
>>>
>>> Сб, 25.07.2026 в 20:50 Jan Schermer писал(а):
>>>> Isn't this enforced by the Yubikey when used for signing? If not, then 
>>>> this looks like a Yubikey vulnerability or incorrect generation in the 
>>>> first place. Or is it just cosmetic?
>>>>
>>>> Jan
>>>>
>>>>
>>>>> On 25. 7. 2026, at 20:40, Savely Krasovsky via openssh-unix-dev <openssh-unix-dev at mindrot.org> wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> Resident credentials created with verify-required may lose the
>>>>> SSH_SK_USER_VERIFICATION_REQD flag when downloaded using ssh-keygen -K
>>>>> or ssh-add -K from authenticators with built-in UV.
>>>>> 
>>>>> The credential retains FIDO_CRED_PROT_UV_REQUIRED, but the downloaded
>>>>> OpenSSH key gets flags 0x21 instead of 0x25.
>>>>> 
>>>>> I have opened a small patch with hardware validation here:
>>>>> 
>>>>> https://github.com/openssh/openssh-portable/pull/701
>>>>> 
>>>>> I used Token2 Bio3 to verify, but this also an issue on YubiKey Bio,
>>>>> but I don't have it on hands rn.
>>>>> 
>>>>> Thanks,
>>>>> Savely Krasovsky
>>>>> _______________________________________________
>>>>> openssh-unix-dev mailing list
>>>>> openssh-unix-dev at mindrot.org
>>>>> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
>>>
>>> -- 
>>> Best regards,
>>> Savely Krasovsky
>>> _______________________________________________
>>> openssh-unix-dev mailing list
>>> openssh-unix-dev at mindrot.org
>>> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
>>
>> -- 
>> Best regards,
>> Savely Krasovsky
>
> -- 
> Best regards,
> Savely Krasovsky
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev at mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


More information about the openssh-unix-dev mailing list