NFTs that don’t have a checkpoint can’t be transferred
The removeDelegation function underflows when a token has no checkpoints, causing a revert that prevents transferring such tokens. An attacker could not exploit this for gain, but it temporarily blocks transfers for affected tokens.
Submitted by 0x52, also found by 0xsanson
Submitting as high risk because it breaks a fundamental operation (transferring) for a large number of tokens.
Proof of Concept
uint256 nCheckpoints = numCheckpoints[tokenId];
Checkpoint storage checkpoint = checkpoints[tokenId][nCheckpoints - 1];
L242 of transferFrom() calls removeDelegation() with the tokenId of the token being transferred. For tokens that don’t have any checkpoints, L212 will return 0. This was cause an underflow error and revert in L213.
Recommended Mitigation Steps
Make removeDelegation simply return if nCheckpoints = 0.
Unsure if high risk, but warden correctly identified the issue (that some others didn’t) that the underflow in
removeDelegationwill prevent tokens from being transferred.
zeroexdead (Golom) disagreed with severity
LSDan (judge) decreased severity to Medium and commented:
Marking this as a medium risk because it only temporarily breaks functionality. The workaround would be to delegate the token and then transfer it, making the impact aggravating but ultimately minimal.
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 code assumes at least one checkpoint exists and subtracts one from zero, causing an underflow.
Impact
Transfers of tokens without checkpoints revert, temporarily breaking a core function; a workaround exists by delegating first, so impact is limited.
What the attacker needed
Token has no checkpoints; transfer attempted
The fix
The function should return early when there are no checkpoints, avoiding the underflow.
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.
When you transfer an NFT, the contract tries to remove any voting delegation attached to it. If the NFT never had a delegation, the code still tries to read a list entry that doesn't exist, which makes the transaction fail. So some NFTs simply cannot be transferred until the owner first delegates them.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.