Commit 7134114
committed
Fix stack buffer overflow in wc_HpkeLabeledExtract via oversized ECH config
SetEchConfigsEx accepted arbitrarily large ECH configs without bounds
checking rawLen. This allowed attacker-controlled data (from DNS HTTPS
records or TLS retry_configs) to overflow the fixed 512-byte labeled_ikm
stack buffer in wc_HpkeLabeledExtract during ClientHello construction.
Add MAX_ECH_CONFIG_RAW_SZ to reject oversized configs at parse time, and
add bounds checks in both wc_HpkeLabeledExtract and wc_HpkeLabeledExpand
before writing into their fixed-size buffers.
Fixes ZD#213091 parent b3f08f3 commit 7134114
4 files changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
573 | 580 | | |
574 | 581 | | |
575 | 582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9986 | 9986 | | |
9987 | 9987 | | |
9988 | 9988 | | |
| 9989 | + | |
| 9990 | + | |
| 9991 | + | |
| 9992 | + | |
9989 | 9993 | | |
9990 | 9994 | | |
9991 | 9995 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
476 | 483 | | |
477 | 484 | | |
478 | 485 | | |
| |||
520 | 527 | | |
521 | 528 | | |
522 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
523 | 538 | | |
524 | 539 | | |
525 | 540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
89 | 98 | | |
90 | 99 | | |
91 | 100 | | |
| |||
0 commit comments