Commit 1d81c65
committed
fix: pad kind:445 and Welcome plaintexts to fixed-size buckets
Pad the MLS plaintext to a power-of-two bucket before encryption so a relay
observer cannot fingerprint message classes by on-the-wire size.
- kind:445 group messages floor at 512 bytes (chosen so an empty SelfRemove
PublicMessage and a typical short text-note rumor land in the same
bucket — a 256-byte floor leaves them distinguishable because the inner
rumor JSON already pushes a "hi" message to ~280 bytes of MLS
PrivateMessage plaintext).
- Welcome rumor payloads floor at 1024 bytes so small-group invitations
share a bucket regardless of exact member count.
Receivers switch from MlsMessageIn::tls_deserialize_exact to non-strict
tls_deserialize so trailing zero-padding bytes are ignored; legacy
unpadded messages continue to decode unchanged. The Welcome receiver
path already used non-strict deserialization.
Closes marmot-protocol/marmot-security#33 (Welcome size leaks group size)
Closes marmot-protocol/marmot-security#37 (SelfRemove size leaks departure intent)1 parent 592a582 commit 1d81c65
5 files changed
Lines changed: 525 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
0 commit comments