$ cat writeup.md…
$ cat writeup.md…
avitoctf
Task: analyze an XMSSMT-MD5 authentication service where concurrent registration can reuse a signing index and expose WOTS+ chain values. Solution: combine duplicate-index signatures per chain, hash forward to vipuser digits, and replace only the bottom WOTS block.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
The supplied TCP service registers users and returns a hexadecimal HoneyPass token containing an
XMSSMT-MD5 signature followed by the username. A valid token for the seeded VIP profile vipuser
allows its full wall post to be viewed. The source package redacts that post's flag, so local testing
can prove the cryptographic exploit but cannot recover the competition's real flag.
params.c configures XMSSMT with:
n = 16;w = 256, hence one base-256 digit per byte;d = 4 layers of height 8;The signed token layout is:
index (4) || R (16) || bottom WOTS (18*16) || bottom auth path (8*16) || layer 1 WOTS || auth path || layer 2 WOTS || auth path || layer 3 WOTS || auth path || username
The public key is root || pub_seed, 16 bytes each. For index idx, randomness R, and message
m, the bottom-layer WOTS signs:
H_msg = MD5(pad(2) || R || root || idx_as_16_bytes || m)
The 18 WOTS chain digits are the 16 bytes of H_msg, followed by the two-byte big-endian value
sum(255 - digest_byte). The checksum matters: satisfying only the 16 digest inequalities is not
enough.
Registration deliberately splits the stateful signature operation:
xmssmt_sign_message() reads the shared signing index and produces a signature.xmssmt_update_signing_key() advance the shared index....
$ grep --similar