Submitted by 0xjuan, also found by CaeraDenoir, santiellena, Tigerfrake, Timenov, and novamanbg
When a user wants to use V3Utils, one of the flows stated by the protocol is as follows:
Now this is usually a safe design pattern, but the issue is that V3Utils.execute() does not validate the owner of the UniV3 Position NFT that is being handled. This allows anybody to provide arbitrary instructions and call V3Utils.execute() once the NFT has been approved in TX1.
A malicious actor provide instructions that include the following:
This would collect all liquidity from the position that was approved, and send it to the malicious attacker who didnt own the position.
The entire liquidity of a specific UniswapV3 liquidity provision NFT can be stolen by a malicious actor, with zero cost.
This foundry test demonstrates how an attacker can steal all the liquidity from a UniswapV3 position NFT that is approved to the V3Utils contract.
To run the PoC:
Console output:
Add a check to ensure that only the owner of the position can call V3Utils.execute.
Note the fix also checks for the case where a user may have transferred the token into the V3Utils. In that case it is fine that msg.sender != tokenOwner, since tokenOwner would then be the V3Utils contract itself.
Access Control
kalinbas (Revert) confirmed
Revert mitigated:
Status: Mitigation confirmed. Full details in reports from thank_you, ktg and b0g0.
