File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ import (
8
8
"github.com/go-webauthn/webauthn/protocol/webauthncbor"
9
9
)
10
10
11
- var (
11
+ const (
12
12
minAuthDataLength = 37
13
13
minAttestedAuthLength = 55
14
+ maxCredentialIDLength = 1023
14
15
)
15
16
16
17
// Authenticators respond to Relying Party requests by returning an object derived from the
@@ -203,6 +204,10 @@ func (a *AuthenticatorData) unmarshalAttestedData(rawAuthData []byte) (err error
203
204
return ErrBadRequest .WithDetails ("Authenticator attestation data length too short" )
204
205
}
205
206
207
+ if idLength > maxCredentialIDLength {
208
+ return ErrBadRequest .WithDetails ("Authenticator attestation data credential id length too long" )
209
+ }
210
+
206
211
a .AttData .CredentialID = rawAuthData [55 : 55 + idLength ]
207
212
208
213
a .AttData .CredentialPublicKey , err = unmarshalCredentialPublicKey (rawAuthData [55 + idLength :])
You can’t perform that action at this time.
0 commit comments