Commit 1a69741
committed
fix(osmosis): fence MsgSend to uosmo — the firmware signs a denom it does not display
Review found that removing the old denom whitelist opened a real
display/signature divergence, and that my test certified it as correct.
osmosis_signTxUpdateMsgSend takes only (amount, to_address) and hardcodes
"denom":"uosmo" into the amino JSON it hashes; fsm_msgOsmosisMsgAck renders
whatever denom arrived. So a uatom send DISPLAYS "1500000 uatom" and SIGNS
1500000 uosmo. Exploitable in the large: a big number of some worthless
ibc/... token on screen, a big number of OSMO in the signature.
osmosis_signTxUpdateMsgDelegate already takes a denom — MsgSend is the
outlier, and this is a pre-existing firmware bug my client change made
reachable.
Fenced client-side until the firmware serializer accepts a denom. The denom
is still forwarded, since the firmware needs it to decide whether to scale
and the fence is the temporary half.
test_osmosis_send_unknown_denom_shown_raw asserted only len(signature)==64,
so it PASSED against that divergence and published it as intended behaviour —
worse than no test. Replaced with one that asserts the refusal, and documents
the check to write once the firmware is fixed: otherwise-identical uosmo and
uatom transactions must produce DIFFERENT signatures.
Also corrects two overstatements the same review caught:
- "exact at any magnitude" was false. osmosis_formatAmount converts with an
unchecked strtoull(), so it is exact only for a canonical decimal uint64.
strtoull saturates past UINT64_MAX and accepts whitespace, a sign and 0x —
"18446744073709551616" and "-1" both display as 18446744073.709551615 OSMO
while the original string is hashed. Same divergence, different disguise;
needs a firmware-side canonical-range check.
- G36 claimed enforcement of the extension cap, the 1-8 count bound and
per-weight range. The mapped test asserts only unsorted, duplicate and
over-100%. Narrowed to what it actually proves.
P4 no longer carries a screenshot hint: the refusal happens client-side, so
there is no frame to capture.1 parent 52e1fb5 commit 1a69741
3 files changed
Lines changed: 66 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1003 | 1003 | | |
1004 | 1004 | | |
1005 | 1005 | | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
1009 | 1020 | | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
1010 | 1027 | | |
1011 | 1028 | | |
1012 | 1029 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
992 | 992 | | |
993 | 993 | | |
994 | 994 | | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
1000 | 1003 | | |
1001 | 1004 | | |
1002 | 1005 | | |
| |||
1553 | 1556 | | |
1554 | 1557 | | |
1555 | 1558 | | |
1556 | | - | |
1557 | | - | |
1558 | | - | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
1559 | 1568 | | |
1560 | 1569 | | |
1561 | 1570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
| |||
112 | 121 | | |
113 | 122 | | |
114 | 123 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
120 | 140 | | |
121 | 141 | | |
122 | 142 | | |
123 | 143 | | |
124 | | - | |
125 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
126 | 147 | | |
127 | 148 | | |
128 | 149 | | |
| |||
0 commit comments