Commit edf7952
fix(tbtc/signer): bound interactive session registry and validate threshold
Two findings on the 7.1 path:
P2 (liveness/DoS) - an interactive open that later expired or was
aborted before Round2 left an otherwise-empty SessionState in the
registry. Since open inserts new session IDs and
ensure_session_insert_capacity counts every map entry, a caller could
churn unique sessions until TBTC_SIGNER_MAX_SESSIONS filled, after
which DKG / build_tx / new interactive sessions were rejected until
restart. The TTL sweep and abort now drop a session that holds nothing
durable once its live attempt is cleared, via a new
SessionState::is_disposable that checks EVERY field so a session still
carrying consumed markers or DKG material is never removed.
P2 (verify-before-consume) - Open accepted a threshold below the key
package's min_signers; Round2 would then accept a too-small signing
package, persist the consumed marker, and only then have
frost::round2::sign fail on the commitment count - burning the nonce
for a validation error. Open now rejects threshold != key package
min_signers before storing the session.
Tests: open-then-abort churn under a 2-session cap stays bounded (no
accumulation); the abort-sweep test now asserts the empty session is
dropped, not just cleared; threshold-below-min_signers is rejected and
the matching threshold opens. Full suite 264 passed / 1 ignored,
clippy -D warnings clean, chaos suite green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 0d739a5 commit edf7952
3 files changed
Lines changed: 172 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
| |||
524 | 537 | | |
525 | 538 | | |
526 | 539 | | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
527 | 552 | | |
528 | 553 | | |
529 | 554 | | |
| |||
704 | 729 | | |
705 | 730 | | |
706 | 731 | | |
707 | | - | |
| 732 | + | |
708 | 733 | | |
709 | 734 | | |
710 | 735 | | |
711 | 736 | | |
712 | 737 | | |
713 | 738 | | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
718 | 743 | | |
719 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
720 | 754 | | |
721 | 755 | | |
722 | 756 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
116 | 154 | | |
117 | 155 | | |
118 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12444 | 12444 | | |
12445 | 12445 | | |
12446 | 12446 | | |
| 12447 | + | |
| 12448 | + | |
| 12449 | + | |
12447 | 12450 | | |
12448 | | - | |
12449 | | - | |
12450 | | - | |
12451 | | - | |
12452 | 12451 | | |
12453 | | - | |
12454 | | - | |
| 12452 | + | |
| 12453 | + | |
12455 | 12454 | | |
12456 | 12455 | | |
12457 | 12456 | | |
| |||
12687 | 12686 | | |
12688 | 12687 | | |
12689 | 12688 | | |
| 12689 | + | |
| 12690 | + | |
| 12691 | + | |
| 12692 | + | |
| 12693 | + | |
| 12694 | + | |
| 12695 | + | |
| 12696 | + | |
| 12697 | + | |
| 12698 | + | |
| 12699 | + | |
| 12700 | + | |
| 12701 | + | |
| 12702 | + | |
| 12703 | + | |
| 12704 | + | |
| 12705 | + | |
| 12706 | + | |
| 12707 | + | |
| 12708 | + | |
| 12709 | + | |
| 12710 | + | |
| 12711 | + | |
| 12712 | + | |
| 12713 | + | |
| 12714 | + | |
| 12715 | + | |
| 12716 | + | |
| 12717 | + | |
| 12718 | + | |
| 12719 | + | |
| 12720 | + | |
| 12721 | + | |
| 12722 | + | |
| 12723 | + | |
| 12724 | + | |
| 12725 | + | |
| 12726 | + | |
| 12727 | + | |
| 12728 | + | |
| 12729 | + | |
| 12730 | + | |
| 12731 | + | |
| 12732 | + | |
| 12733 | + | |
| 12734 | + | |
| 12735 | + | |
| 12736 | + | |
| 12737 | + | |
| 12738 | + | |
| 12739 | + | |
| 12740 | + | |
| 12741 | + | |
| 12742 | + | |
| 12743 | + | |
| 12744 | + | |
| 12745 | + | |
| 12746 | + | |
| 12747 | + | |
| 12748 | + | |
| 12749 | + | |
| 12750 | + | |
| 12751 | + | |
| 12752 | + | |
| 12753 | + | |
| 12754 | + | |
| 12755 | + | |
| 12756 | + | |
| 12757 | + | |
| 12758 | + | |
| 12759 | + | |
| 12760 | + | |
| 12761 | + | |
| 12762 | + | |
| 12763 | + | |
| 12764 | + | |
| 12765 | + | |
| 12766 | + | |
| 12767 | + | |
| 12768 | + | |
| 12769 | + | |
| 12770 | + | |
| 12771 | + | |
| 12772 | + | |
| 12773 | + | |
| 12774 | + | |
| 12775 | + | |
| 12776 | + | |
| 12777 | + | |
0 commit comments