-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing AuthenticatorData Failure With Extensions #124
Comments
@felix-gohla Thank you for creating this issue, and for providing examples of authenticator data. I created PR #125 to improve |
Nice! Thank you very very much. 😊 |
@felix-gohla This fix is now available in |
So cool, thank you very much for your work! 🌟 |
When parsing the
AuthenticatorData
from an attestation, the library does not consider data from extensions.The format of the attestation object can be found here: https://www.w3.org/TR/webauthn/#sctn-attestation
Currently, everything after the
credential_id
is considered the public key, like can be seen here:py_webauthn/webauthn/helpers/parse_authenticator_data.py
Line 56 in 78a6019
However, this is not true for authenticators returning extension data, which ends up being parsed as a public key.
For example the following
authData
(hex-encoded):leads to the following (wrong) public key (it contains the word
credProtect
, which certainly does not belong into the public key):To resolve this problem, one could parse the bytes from the public key (encoded with COSE) and determine the length. After removing that bytes that form the public key, the rest, as per standard, must be the extension data.
If you're fine with it, I would create a PR, as I already implemented a fix. However, I don't know if the approach mentioned above is the best one.
The text was updated successfully, but these errors were encountered: