On April 21st 2023 an exploiter was able to abuse the UDT reward system from the Unlock contract.

Context

The Unlock contract distributes UDT governance tokens for transactions that purchase NFT memberships (check our docs for more details on the mechanism). In a nutshell, each PublicLock contract calls the recordKeyPurchase on the Unlock contract with a referrer address, as well as the value of the transaction. Then, the Unlock contract computes the amount of UDT tokens to be transferred to the referrer as a reward.

What happened

A malicious actor was able to trick the Unlock contract to distribute UDT rewards held by it. The attack happened in 2 phases.

Each of these transaction calls recordKeyPurchase multiple times in order to accrue as much UDT as possible.

We estimate that a total of 21,147.32 UDT were transferred from the Unlock contract.

These tokens were immediately swapped using Uniswap as part of the transactions on which they are rewarded.

Remedies

First, the team submitted an emergency upgrade to the Unlock contract that includes the following:

We have also: