Commit b51bc2b
committed
security(wasm): bound WASM output reads to prevent OOM from malicious modules
Add MAX_ROUTE_OUTPUT_SIZE (16MB) and MAX_TASK_OUTPUT_SIZE (16MB) limits
to validate out_len before reading WASM memory in execute_get_routes,
execute_handle_route, and execute_get_tasks. Without these bounds, a
malicious WASM module could return an arbitrarily large out_len value,
causing the host to attempt allocation of a huge buffer and potentially
trigger an OOM condition.1 parent 38a2e14 commit b51bc2b
1 file changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
470 | 472 | | |
471 | 473 | | |
472 | 474 | | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
473 | 483 | | |
474 | 484 | | |
475 | 485 | | |
| |||
632 | 642 | | |
633 | 643 | | |
634 | 644 | | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
635 | 653 | | |
636 | 654 | | |
637 | 655 | | |
| |||
735 | 753 | | |
736 | 754 | | |
737 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
738 | 764 | | |
739 | 765 | | |
740 | 766 | | |
| |||
0 commit comments