In September 2022, users of Profanity, a vanity address generator for Ethereum, were the targets of an attack. Attackers took advantage of a weakness in the wallet’s key generation process to access and drain $3.3 million in tokens from users’ wallets.

Inside the Attack

As stated above, the Profanity tool is a vanity wallet address generator. While most Ethereum wallet addresses are random, these vanity addresses are designed to contain a particular word, such as someone’s name, somewhere within the address. Vanity addresses are computed by calculating many different public/private keypairs and looking for one that meets the criteria.

Generation of random values, such as private keys, is commonly performed using a cryptographic pseudorandom number generator (CPRNG) seeded with a random value. In this case, Profanity seeded the CPRNG with an unsigned integer, meaning that there were only 232 (about 4.3 billion) possible seed values.

While this may seem like a lot, it is not sufficient security against brute force attacks. According to estimates on an issue raised on Profanity’s GitHub, a set of 1,000 GPUs could theoretically brute force the private keys of every 7-character vanity address generated using Profanity within 50 days. And while this operation would be expensive, the return on investment could be significant. 

1inch researchers originally identified and shared their findings on a vulnerability with Profanity in early 2022.  They recently drew attention to the issue when it became clear that attackers had already stolen approximately $3.3 million in tokens and more addresses were at risk than previously assumed. The popularity of the Profanity tool meant that the value held in wallets using vanity addresses generated using the tool could be in the tens of millions or hundreds of millions of dollars.

Lessons Learned From the Attack

The Profanity vulnerability address generator was abandoned by its creator multiple years ago. When performing high-risk cryptographic operations — such as private key generation — it is best to use a tool that is reputable, audited, and still actively supported.

Vanity addresses can be secured against brute force attacks if properly generated. To learn more about securely creating and managing your blockchain account private keys, reach out to our Web3 security experts at halborn@protonmail.com.

Explained: The Profanity Address Generator Hack (September 2022)
Rob Behnke
09.20.2022