Skip to content
Smart contracts Audit finding Intermediate

Using transferFrom on ERC721 tokens

The PrizePool contract uses transferFrom instead of safeTransferFrom when awarding external ERC721 tokens, so tokens sent to a contract winner that cannot handle ERC721 could be locked. An attacker could also exploit safeTransferFrom to cause a denial of service by rejecting tokens.

shw Follow

Originally disclosed on Code4rena

Submitted by shw

In the function awardExternalERC721 of contract PrizePool, when awarding external ERC721 tokens to the winners, the transferFrom keyword is used instead of safeTransferFrom. If any winner is a contract and is not aware of incoming ERC721 tokens, the sent tokens could be locked.

Recommend consider changing transferFrom to safeTransferFrom at line 602. However, it could introduce a DoS attack vector if any winner maliciously rejects the received ERC721 tokens to make the others unable to get their awards. Possible mitigations are to use a try/catch statement to handle error cases separately or provide a function for the pool owner to remove malicious winners manually if this happens.

asselstine (PoolTogether) confirmed and disagreed with severity:

This issue poses no risk to the Prize Pool, so it’s more of a 1 (Low Risk IMO.

This is just about triggering a callback on the ERC721 recipient. We omitted it originally because we didn’t want a revert on the callback to DoS the prize pool.

However, to respect the interface it makes sense to implement it fully. That being said, if it does throw we must ignore it to prevent DoS attacks.

dmvt (judge) commented:

I agree with the medium risk rating provided by the warden.

The original report as published on Code4rena, by shw. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the contract used transferFrom instead of safeTransferFrom, which skips the recipient contract notification and can lock tokens.

Impact

Tokens could be locked if a winner is a contract that cannot handle ERC721, and a naive fix could introduce a denial-of-service vector.

What the attacker needed

Winner is a contract; contract cannot handle ERC721

The fix

The contract should use safeTransferFrom but handle errors with try/catch or allow the owner to remove malicious winners to prevent DoS.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

ERC721 tokens are like digital collectibles. When you send one to a contract (a program on the blockchain), the contract needs to be told it's receiving it, otherwise the token can get stuck. This report says the code didn't give that notice, so tokens could be lost, but fixing it naively could let a winner block others from getting their prizes.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by shw

View all

22 more disclosed reports, best first.

More from PoolTogether

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.