Skip to content

Code4rena

Unlock Protocol contest

Every publicly disclosed report for Unlock Protocol contest and what kind of bugs they were.

disclosed reports
18
most reported class
Business logic
bug classes found
2
first disclosure
2022
Find Unlock Protocol contest on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Unlock Protocol contest chose to make public.

Audit finding

Unlock: free UDT arbitrage opportunity

The protocol relies on a single slow-updating price oracle for its UDT token, and its token distribution logic rewards referrers. An attacker could buy many keys across multiple locks to obtain UDT, sell it on an exchange where the price is higher, then request refunds, repeating until prices converge.

Unlock Protocol contest

Medium
Business logic

MixinPurchase:shareKey allows to generate keys without purchasing

The shareKey function allows a user to generate new keys without purchasing, even beyond the maximum number of keys. An attacker could create many addresses, buy one key, share minimal time with each address to generate new keys, and thereby cheaply allocate many keys, preventing honest users from purchasing keys due to the notSoldOut modifier.

Unlock Protocol contest

Medium
Business logic

Inaccurate fees computation

The fee calculation in the shareKey function is incorrect when the time remaining is less than the computed fee time, causing the receiver to be credited less time than they should. An attacker could exploit this to pay a larger fee than intended when transferring time.

Unlock Protocol contest

Medium
Business logic

Missing maxNumberOfKeys checks in shareKey and grantKey

The shareKey and grantKey functions mint new keys without checking the lock's maxNumberOfKeys limit, unlike the purchase function. An attacker could mint more keys than intended, though the protocol team stated that for grantKey this is intentional and only confirmed the issue for shareKey.

Unlock Protocol contest

Medium
Access control

Approvals not cleared after key transfer

The transferFrom function in the Unlock Protocol's lock contract does not always clear single-token approvals when a key is transferred to a recipient whose previous key had expired. An attacker could sell a key and then reclaim it using a leftover approval.

Unlock Protocol contest

High
Business logic

MEV miner can mint larger than expected UDT total supply

The Unlock Protocol calculates gas reimbursement using the transaction's gas price, which a miner can arbitrarily set. A malicious miner could therefore inflate the number of UDT tokens minted as reimbursement, potentially up to half the total supply, and sell them for profit.

Unlock Protocol contest

High
Business logic

Potential economic attack on UDT grants to the referrer

The Unlock protocol rewards referrers with UDT tokens based on a hardcoded estimated gas cost, which can be exploited by using gas-saving tokens to make the actual gas cost much lower than the estimate, allowing an attacker to mint excess UDT. An attacker could profit by creating a lock with a gas-saving token and calling purchase many times.

Unlock Protocol contest

Medium
Business logic

Support of different ERC20 tokens

The purchase function transfers ERC20 tokens without checking the return value or the actual amount received, so tokens that return false or are deflationary/rebasing could cause the contract to accept payment without receiving the expected value. An attacker could exploit this if the lock manager uses such a token, potentially acquiring keys without paying the full price.

Unlock Protocol contest

Medium
Business logic

Key buyers will not be able to get refund if lock manager withdraws profits

The lock manager can withdraw all funds from a lock, leaving insufficient balance for key buyers to receive refunds when they cancel their keys. An attacker (or even a non-malicious manager) could accidentally or deliberately disable refunds, causing users to lose the ability to get their money back.

Unlock Protocol contest

Medium
Business logic

Key transfer will destroy key if from==to

The transferFrom function in Unlock Protocol's smart contract destroys a key when the sender and recipient are the same address, because it expires and resets the key after incorrectly extending its expiration. An approved key manager could accidentally destroy a user's token, causing the user to lose the key without a refund.

Unlock Protocol contest

Medium
Business logic

Referrer discount token amount can be manipulated

The Unlock protocol mints UDT tokens to referrers based on the transaction gas price, which the purchaser controls. An attacker could buy a key with themselves as referrer at a high gas price to receive more UDT tokens, potentially profiting if the market price of UDT is favourable.

Unlock Protocol contest

Medium
Business logic

Missing scaling factor in recordKeyPurchase ?

The recordKeyPurchase function computes maxTokens using integer division that likely truncates a term to zero, so the intended asymptotic curve is not applied. An attacker could receive more token rewards than intended.

Unlock Protocol contest

Medium
Business logic

MixinRefunds: frontrun updateKeyPricing() for free profit

A lock owner can increase the key price, but a user can frontrun that update by buying keys at the old lower price and then requesting a refund at the new higher price, receiving more money than they paid. This allows the attacker to drain the lock's funds.

Unlock Protocol contest

Medium
Business logic

Wrong design/implementation of freeTrial allows attacker to steal funds from the protocol

The freeTrial feature allows a user to get a full refund before the trial ends, and users can transfer part of their time to another user via shareKey. An attacker could transfer trial time from multiple addresses to one address, accumulate up to expirationDuration, and then call cancelAndRefund to steal funds from the protocol.

Unlock Protocol contest

High