-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Systemic presence of extra byte for registration with eddsa #436
Comments
Hi @Gashmob, Thank you for the detailed report. I tried to reproduce it with a Yubikey 5 (firmware 5.1.2) and I cannot reproduce that issue. Many thanks. |
Hi,
Same on my side but our Yubikeys does not support EdDSA:
|
The options: {
"rp": {
"name": "Tuleap",
"id": "tuleap-web.tuleap-aio-dev.docker"
},
"user": {
"name": "admin",
"id": "MTAx",
"displayName": "Site Administrator"
},
"challenge": "oq1vpg74u-TmqW3Dv2LwU_jH00NQf65OqpMhrvr7yPY",
"pubKeyCredParams": [
{
"type": "public-key",
"alg": -8
},
{
"type": "public-key",
"alg": -7
},
{
"type": "public-key",
"alg": -257
}
],
"attestation": "none"
} And the response: {
"clientExtensionResults": {},
"id": "ma2Y7hbtrzJtoDR4N2PkazhnrO6_58gZ8mO8epx-6aCnR9Jtio8Ge1w0_msV7HniYmLIH9yxOW8Yu_9ze_y8oj-MehAozj1jFTsjlQUEc_dxdzG5uFJTn6_RnzhulEWCcZZwcvlNTYne99MpWAD31c-4IuEr-eRRV1DWSANcax0",
"rawId": "ma2Y7hbtrzJtoDR4N2PkazhnrO6_58gZ8mO8epx-6aCnR9Jtio8Ge1w0_msV7HniYmLIH9yxOW8Yu_9ze_y8oj-MehAozj1jFTsjlQUEc_dxdzG5uFJTn6_RnzhulEWCcZZwcvlNTYne99MpWAD31c-4IuEr-eRRV1DWSANcax0",
"response": {
"attestationObject": "o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YVkBCRawLfvD1MyjfrwvZRZlmxIhDbnhAYq58TqWkGOOpv2oRQAAAAIvwFefgRNH6rEWu1qNuSAqAICZrZjuFu2vMm2gNHg3Y-RrOGes7r_nyBnyY7x6nH7poKdH0m2KjwZ7XDT-axXseeJiYsgf3LE5bxi7_3N7_LyiP4x6ECjOPWMVOyOVBQRz93F3Mbm4UlOfr9GfOG6URYJxlnBy-U1Nid730ylYAPfVz7gi4Sv55FFXUNZIA1xrHaMBY09LUAMnIGdFZDI1NTE5IZggCBjXGDcYzBgpGFwYlBgcGJYYTxjdGOYY8BjyGL4YPxg7GEgYfBh_GCIYKxhgChgmGIQYkhhQGH0Y1hjoGIk",
"clientDataJSON": "eyJjaGFsbGVuZ2UiOiJvcTF2cGc3NHUtVG1xVzNEdjJMd1VfakgwME5RZjY1T3FwTWhydnI3eVBZIiwib3JpZ2luIjoiaHR0cHM6Ly90dWxlYXAtd2ViLnR1bGVhcC1haW8tZGV2LmRvY2tlciIsInR5cGUiOiJ3ZWJhdXRobi5jcmVhdGUifQ"
},
"type": "public-key"
} |
Many thanks for the additional input. It tried to read the data on https://cbor.me/, but the result is the same: the object is not valid. |
Excellent. Many thanks for the information. I was not aware of those details. Unfortunately, it is not possible to upgrade to the latest firmware version |
When I've decoded the binary by hand, I've that authenticator data length is 261 bytes, it's coherent, it's exactly the amount that remains. But when I was at the public key cbor map, the lenght of the map was 3: key type, algorithm and curve. But yes, for okp key we need the also the field -2 for x (https://www.rfc-editor.org/rfc/rfc9053#name-octet-key-pair). If we assume that the map has length 4, the next field is -2, but its value is not a byte string but an array of 32 unsigned int. Even if it was extensions (but extension flag is set to 0), the format was not valid, I've found first a negative integer and not a map.
I've tried on firefox and chrome, but same problem on each. |
This is exactly my conclusion.
The key seems to be correct because we are expecting 32 bytes for the
If it doesn't come up for the browser, I guess the key itself is causing the problem. |
Hi, it works well 👍 Thank you! |
Closing as merged. Will be released soon |
Closes web-auth#448 Previously added for issue web-auth#436, the field kty must be text string or int but not byte string (rfc8152 section 7)
* Fix wrong creation of eddsa public key Closes #448 Previously added for issue #436, the field kty must be text string or int but not byte string (rfc8152 section 7) * Add tests to check if fixed OKP key can be check by validator issue #448 * Fix coding standard & cose-lib dependency version in webauthn package * cose-lib 4.2.3+ required --------- Co-authored-by: Florent Morselli <florent.morselli@spomky-labs.com>
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version(s) affected
4.5.1
Description
In goal to register a passkey on a website, I use your sub-library webauthn. When I try to register a new credential with eddsa as 'prefered' algorithm, the load of passkey's response failed for presence of extra bytes in authentication data (L146 in AttestationObjectLoader.php). If I comment this line then all is good.
I've tried to decompose the attestion object by hand and find that :
If we follow strictly the webauthn doc, yes, there is some extra bytes. I've also tried to use the duo-labs in python to check the response and have exactly the same problem: an error is raised for presence of extra bytes.
Did we really need to check that ?
How to reproduce
In backend, to generate options I do:
These options are sent to front as they are. Then I use this nodejs lib https://simplewebauthn.dev/docs/packages/browser/, and the result is sent back to the backend:
Possible Solution
No response
Additional Context
The passkey used is a Yubikey 5 NFC (firmware 5.4.3)
The text was updated successfully, but these errors were encountered: