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.
The refund mechanism calculates the refund based on the current key price rather than the price the user originally paid. A user who refunds after a price change can receive less (or more) funds than they deserve.
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.
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.
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.
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.
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.
The transferFrom function fails to reset the key manager when the recipient has no existing key, allowing the sender to retain key manager rights after transferring the key. An attacker could then transfer the key back or to another recipient, potentially causing financial loss to the buyer.
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.
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.
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.
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.
The PublicLock contract's initialize function lacked access control, allowing anyone to call it before the legitimate deployer. An attacker could front-run the setLocktemplate call, forcing the deployer to redeploy and potentially draining funds through repeated attacks.
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.
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.
The refund mechanism allows a user to cancel a purchase and receive a full refund, then repurchase and receive a new free trial period. An attacker could repeat this to obtain unlimited free trials, causing financial loss to lock owners who offer free trials.
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.
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.
UP
Unlock Protocol contest
High
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.