Platform: Code4rena
Start Date: 04/03/2024
Pot Size: $88,500 USDC
Total HM: 31
Participants: 105
Period: 11 days
Judge: ronnyx2017
Total Solo HM: 7
Id: 342
League: ETH
Rank: 61/105
Findings: 1
Award: $72.54
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: y0ng0p3
Also found by: 0xk3y, 0xspryon, Mike_Bello90, Myd, falconhoof, lightoasis, th3l1ghtd3m0n
72.5395 USDC - $72.54
https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/transformers/AutoCompound.sol#L163
Actions in the Uniswap NonfungiblePositionManager contract are protected by a deadline parameter to limit the execution of pending transactions. Functions that modify the liquidity of the pool check this parameter against the current block timestamp in order to discard expired actions.
User provided deadline arguments are utilized in transformers AutoRange.sol and LeverageTransformer.sol while interacting with the Uniswap NFT Position Manager. However, the execute() function in AutoCompound.sol uses block.timestamp as the deadline argument, which defeats the purpose of using a deadline. Using block.timestamp as the deadline is effectively a no-operation that has no effect nor protection. Since block.timestamp will take the timestamp value when the transaction gets mined, the check will end up comparing block.timestamp against itself.
Failure to provide a proper deadline value enables pending transactions to be maliciously executed at a later point in detriment of the submitter.
(, state.compounded0, state.compounded1) = nonfungiblePositionManager.increaseLiquidity( INonfungiblePositionManager.IncreaseLiquidityParams( params.tokenId, state.maxAddAmount0, state.maxAddAmount1, 0, 0, block.timestamp ) );
Manual Review
Add a deadline parameter to the ExecuteParams struct and forward it to the corresponding underlying call to the Uniswap NonfungiblePositionManager contract.
Uniswap
#0 - c4-pre-sort
2024-03-18T13:55:04Z
0xEVom marked the issue as duplicate of #147
#1 - 0xEVom
2024-03-18T13:55:13Z
Only mentions execute()
#2 - c4-pre-sort
2024-03-18T14:38:49Z
0xEVom marked the issue as sufficient quality report
#3 - c4-judge
2024-03-31T16:02:08Z
jhsagd76 marked the issue as satisfactory