Resources

People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!

SecondFi Exploit- 2090

RektPosted 13 Days Ago
  • SecondFi is a wallet primarily for the Cardano platform. Recently, multiple users had their wallet drained. This is the story of what happened.
  • The signature type for the Cardano is extended Ed25519. The wallet stores a 64-byte extended secret key that is split into a signing scalar, and a secret nonce prefix. The nonce is derived by hashing the nonce with the transaction body together.
  • The nonce on these signatures must remain secret. Otherwise, some basic math can be used to recover the key. Instead of using the secret nonce prefix, and transaction body alongside a hash as the secret, the nonce was computed r = SHA512(M). Notably, the blockchain has no way to determine that the nonce was insecurely generated or not. For details on how to recover the key, read this part of the article.
  • Any user that signed a transaction from June 8th-June 23rd, 2026 used the new vulnerable implementation. This led to over 300 wallets getting drained because their private key had been discovered. There's a good breakdown of the bug here as well. All in all, $2.4M was stolen.
  • How did this get into production? The wallet originally used cardano-serialization-lib under the hood. In a rewrite to the SDK to do it in-house, the per-user secret nonce was not included in the hash, leading to the bug. They were planning on doing an audit post release but this doesn't help very much.