Skip to content
Crypto Write-up Advanced

Croc Full Plaintext Recovery Attack – CVE-2021-31603

Croc's SPAKE2 implementation allowed the recipient to choose the public identities U and V, whose discrete logarithms were known to the attacker. A rogue recipient could therefore reduce the key entropy to that of the passcode and brute-force the encryption key, decrypting all files sent through any relay.

redrocket.club

Published on redrocket.club

This blog post describes various security vulnerabilities we found within the popular file sharing service croc. These vulnerabilities can be chained together to launch file interception attacks against croc’s relay server.

The author, on redrocket.club

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

A remote attacker could intercept and decrypt all files sent via croc through any relay, without needing to host a malicious gateway.

What the attacker needed

Network access to the relay; sender initiates a transfer; attacker joins the correct room

The fix

The SPAKE2 implementation should hardcode the public identities U and V with a proof that their discrete logarithms are unknown, and check that the two hashes differ; the room identifier should not be derived from the passcode.

How it was found

  1. Join the victim's room on the relay, knowing the room is the first three letters of the passcode.
  2. Act as a normal recipient and send the SPAKE2 parameters X, U, and V, choosing U and V with known discrete logarithms.
  3. Receive the sender's Y and bcrypt hash, then replay the sender's hash back to bypass the check.
  4. Reply with the same salt the sender sends.
  5. Brute-force the encryption key using the known plaintext prefix of the first encrypted message.
  6. Decrypt the file with the recovered key.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Croc is a file-sharing tool that uses a short three-word passphrase to set up encryption. The bug let the receiving side pick special values that made the secret key much weaker than intended, so an attacker pretending to be the receiver could guess the passphrase and read the files.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.