CLI Truncated Tag Authentication fix#222
Conversation
No minimum tag length was enforced. A user supplying a 1-byte tag only needed to match the first byte of the real tag, reducing the authentication check to a 1-in-256 brute-force
Prevented Truncated Tag comparison
|
Hi @ikkebr, there may be a misunderstanding here, this is actually working as intended. When using the CLI, you are in full control of the arguments you pass to it, and can verify any sort of requirements externally, keeping the (C) implementation simple. Anyway, forcing the full tag length is definitely not how it's intended to be used - you'd usually want to check something like 4 bytes. This is what's implemented in the You might be interested in the Rust CLI, which is about to replace the C CLI (#221) and has an additional flag with which you can enforce a minimum length. Lines 42 to 48 in d680822 Cheers, Markus |
The CLI
verifycommand accepts truncated authentication tags of arbitrary length, including a single byte. The verification routine base64url-decodes the user-supplied--tagargument and uses the decoded length as the comparison length forCRYPTO_memcmp(). No minimum tag length is enforced. An attacker supplying a 1-byte tag only needs to match the first byte of the real tag.