-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Webauthn Credential ID length too short #20457
Comments
ffs. They changed the spec. THIS WAS THE SPEC https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#credential-id |
w3c/webauthn#1664 changed the spec |
anyway we'll need yet another migration and we'll need to backport the other migration changes. I don't know what we can do for 1.16 - a doctor command perhaps. |
1.17 should be around the corner. There aren't any other commit pending for a 1.16.10 release. "Just upgrade" advice? |
As an aside: This is literally unbelievable they changed the spec 2 days ago and we're already getting behaviour that demands the new spec?! It's just unreasonable |
WebAuthn have updated their specification to set the maximum size of the CredentialID to 1023 bytes. This is somewhat larger than our current size and therefore we need to migrate. Fix go-gitea#20457 Signed-off-by: Andrew Thornton <[email protected]>
WebAuthn have updated their specification to set the maximum size of the CredentialID to 1023 bytes. This is somewhat larger than our current size and therefore we need to migrate. The PR changes the struct to add CredentialIDBytes and migrates the CredentialID string to the bytes field before another migration drops the old CredentialID field. Another migration renames this field back. Fix #20457 Signed-off-by: Andrew Thornton <[email protected]>
…0530) WebAuthn have updated their specification to set the maximum size of the CredentialID to 1023 bytes. This is somewhat larger than our current size and therefore we need to migrate. The PR changes the struct to add CredentialIDBytes and migrates the CredentialID string to the bytes field before another migration drops the old CredentialID field. Another migration renames this field back. Fix go-gitea#20457 Signed-off-by: Andrew Thornton <[email protected]>
…20555) WebAuthn have updated their specification to set the maximum size of the CredentialID to 1023 bytes. This is somewhat larger than our current size and therefore we need to migrate. The PR changes the struct to add CredentialIDBytes and migrates the CredentialID string to the bytes field before another migration drops the old CredentialID field. Another migration renames this field back. Fix #20457 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: zeripath <[email protected]>
…0530) WebAuthn have updated their specification to set the maximum size of the CredentialID to 1023 bytes. This is somewhat larger than our current size and therefore we need to migrate. The PR changes the struct to add CredentialIDBytes and migrates the CredentialID string to the bytes field before another migration drops the old CredentialID field. Another migration renames this field back. Fix go-gitea#20457 Signed-off-by: Andrew Thornton <[email protected]>
Description
Hi all 👋 I recently received a new FIDO2 security key, a SoloKey v2.
Upon registering it to my Gitea instance, a server error was encountered:
While debugging this, I noticed that a 270 byte credential ID was generated for my instance. It seems that the current maximum credential ID length is 255 bytes:
gitea/models/migrations/v210.go
Line 28 in 886b1de
After some tentative searching through the linked WebAuthn specification, I noticed the following:
I think this issue could be resolved by changing the maximum credential ID length to 1023 bytes raw, or 1640 bytes base32-encoded (per
head -c 1023 /dev/random | base32 --wrap=0 | wc -c
).Gitea Version
1.17.0-rc2
Can you reproduce the bug on the Gitea demo site?
No - its credential ID was exactly 255 bytes, which probably shouldn't be relied on
Log Gist
https://gist.github.com/spotlightishere/8bcfd9591ca7ec421873091c77644e91
Screenshots
No response
Git Version
No response
Operating System
Debian 11
How are you running Gitea?
Downloaded from https://dl.gitea.io/, running underneath systemd
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: