Skip to content

Commit 98cb710

Browse files
Update documentation to avoid PIN bypass
This fixes cedarcode#350, which pointed out a bug in certain browser/device combinations that allow bypassing the user's PIN if the `user_verfication: true` flag is not set. https://hwsecurity.dev/2020/08/webauthn-pin-bypass/
1 parent 314d922 commit 98cb710

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ begin
237237
webauthn_credential.verify(
238238
session[:authentication_challenge],
239239
public_key: stored_credential.public_key,
240-
sign_count: stored_credential.sign_count
240+
sign_count: stored_credential.sign_count,
241+
user_verification: true, # needed for passwordless verification
241242
)
242243

243244
# Update the stored credential sign count with the value from `webauthn_credential.sign_count`
@@ -384,11 +385,14 @@ Verifies the asserted WebAuthn credential is [valid](https://www.w3.org/TR/webau
384385
Mainly, that the client provided a valid cryptographic signature for the corresponding stored credential public
385386
key, among other extra validations.
386387

388+
Note that the `user_verification: true` flag is required to ensure that the the authenticator has verified the user's identity before sending the credentials. See the following [CVE-2020-8236 writeup](https://hwsecurity.dev/2020/08/webauthn-pin-bypass/)
389+
387390
```ruby
388391
credential_with_assertion.verify(
389392
session[:authentication_challenge],
390393
public_key: stored_credential.public_key,
391-
sign_count: stored_credential.sign_count
394+
sign_count: stored_credential.sign_count,
395+
user_verification: true # needed for passwordless verification
392396
)
393397
```
394398

0 commit comments

Comments
 (0)