Common MPC Pitfalls

`axelarnetwork/tofnd` accepts spoofed `from` field on the wire

Axelar’s tofnd is a Rust daemon implementing GG20 (Gennaro–Goldfeder, 2020), a threshold-ECDSA protocol widely deployed in MPC wallet implementations. Each message is wrapped in a TrafficIn envelope that carries both a transport-level sender identity (from_party_uid) and an inner MsgMeta with a protocol-level sender index (from: usize). As reported in Issue #60, the inner from field is unauthenticated: a malicious party can edit it in the binary payload and send messages on behalf of any other party.

The vulnerable handler discarded the transport identity and passed the raw payload straight to the cryptographic core (source):

1// FILE: src/gg20/protocol.rs — axelarnetwork/tofnd (pre-fix, lines 106–117)
2while protocol.expecting_more_msgs_this_round() {
3    let traffic = chan.receiver.next().await.ok_or(...)?;
4    let traffic = traffic.unwrap();
5    // Only `traffic.payload` is forwarded to tofn; the transport-level
6    // `traffic.from_party_uid` is discarded. tofn then trusts the inner
7    // `MsgMeta { from: usize, ... }` self-attribution.
8    protocol.set_msg_in(&traffic.payload)?;
9}

A malicious party Alice with subshares {0, 1} could craft a message with MsgMeta::from = 2 (Bob’s subshare index), and no consistency check linked that index back to the transport-authenticated from_party_uid. The fix is split across two repos: tofn (the cryptographic library tofnd wraps) had to first expose the from field in its public API (Issue #42) so tofnd could then enforce from_party_uid == MsgMeta::from before dispatch.