Commit 8640a90
authored
fix(webauthn): largeBlob.read no longer leaks largeBlobKey to RP (#198)
Per [WebAuthn L3 sec. 10.1.5 (largeBlob
extension)](https://www.w3.org/TR/webauthn-3/#sctn-large-blob-extension),
the relying party expects the `blob` output to be the decrypted
plaintext blob payload, fetched by the platform via the CTAP
[`authenticatorLargeBlobs`](https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorLargeBlobs)
command using the per-credential `largeBlobKey` as an AES-256-GCM key.
The library was instead writing the raw `largeBlobKey` into `blob` and
never calling `authenticatorLargeBlobs`. That means an RP receives the
AES key itself (not the blob), and if the RP can also read the device's
`largeBlobArray` (publicly readable region of the authenticator over
CTAP), it can decrypt and forge entries.
Until `authenticatorLargeBlobs` is wired up (follow-up PR #206), the
safe behaviour is to set `large_blob.blob = None`. The CTAP-level model
keeps the field so the follow-up can use it.
## Changes
- Stop routing `largeBlobKey` into the WebAuthn `large_blob.blob`
output.
- The CTAP-level `Ctap2GetAssertionResponse.large_blob_key` remains so
the next PR can use it.
- Regression test asserts the WebAuthn response no longer contains the
key.
## References
- [WebAuthn L3 sec. 10.1.5: Large blob storage extension
(`largeBlob`)](https://www.w3.org/TR/webauthn-3/#sctn-large-blob-extension)
- [CTAP 2.1 sec. 6.10: `authenticatorLargeBlobs`
(0x0C)](https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorLargeBlobs)1 parent a6f60bf commit 8640a90
2 files changed
Lines changed: 33 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
409 | 408 | | |
410 | 409 | | |
411 | 410 | | |
| |||
815 | 814 | | |
816 | 815 | | |
817 | 816 | | |
818 | | - | |
819 | 817 | | |
820 | 818 | | |
821 | 819 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
497 | 496 | | |
498 | 497 | | |
499 | 498 | | |
| |||
521 | 520 | | |
522 | 521 | | |
523 | 522 | | |
524 | | - | |
| 523 | + | |
525 | 524 | | |
526 | 525 | | |
527 | 526 | | |
| |||
548 | 547 | | |
549 | 548 | | |
550 | 549 | | |
551 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
552 | 553 | | |
553 | 554 | | |
554 | 555 | | |
555 | 556 | | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
| 557 | + | |
564 | 558 | | |
565 | 559 | | |
566 | 560 | | |
| |||
658 | 652 | | |
659 | 653 | | |
660 | 654 | | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
661 | 683 | | |
0 commit comments