Platform: Code4rena
Start Date: 08/09/2023
Pot Size: $70,000 USDC
Total HM: 8
Participants: 84
Period: 6 days
Judge: gzeon
Total Solo HM: 2
Id: 285
League: ETH
Rank: 4/84
Findings: 2
Award: $2,386.72
🌟 Selected for report: 0
🚀 Solo Findings: 0
2352.0285 USDC - $2,352.03
In LiquidityPool.sol, there is a collectDeposit and collectRedeem function with no access control. Anyone can call the function for another party to collect their funds.
//@audit no access control function collectDeposit(address receiver) public { investmentManager.collectDeposit(receiver); emit DepositCollected(receiver); } /// @notice Trigger collecting the deposited tokens. function collectRedeem(address receiver) public { investmentManager.collectRedeem(receiver); emit RedeemCollected(receiver); }
This is a two-part issue, one being no access control over these functions and the second being a potential griefing of the protocol by sending dust amounts of deposits and redemption requests to the gateway to strain the process.
Anyone can call collectDeposit or collectRedeem for anyone, which should not be the case. A potential impact of having no access control is that anyone can spam the gateway by sending many requests with dust amounts, possibly causing a huge bottleneck of deposits for the router to clear.
Manual Review
Add the withApproval() modifier on those functions too.
function collectDeposit(address receiver) public withApproval(owner) { investmentManager.collectDeposit(receiver); emit DepositCollected(receiver); } /// @notice Trigger collecting the deposited tokens. function collectRedeem(address receiver) public withApproval(owner) { investmentManager.collectRedeem(receiver); emit RedeemCollected(receiver); }
This helps filter rogue individuals from straining the gateway. However, it doesn't really help if the user himself is malicious and intentionally calls collectDeposit with dust amounts everytime.
The best way is probably to have a minimum request sum so that users will not be able to grief the protocol by calling dust deposits everytime
Invalid Validation
#0 - c4-pre-sort
2023-09-16T00:43:27Z
raymondfam marked the issue as low quality report
#1 - c4-pre-sort
2023-09-16T00:43:42Z
raymondfam marked the issue as duplicate of #50
#2 - c4-pre-sort
2023-09-17T06:11:43Z
raymondfam marked the issue as duplicate of #143
#3 - c4-pre-sort
2023-09-17T06:12:25Z
raymondfam marked the issue as sufficient quality report
#4 - c4-judge
2023-09-26T14:37:22Z
gzeon-c4 marked the issue as satisfactory
🌟 Selected for report: ciphermarco
Also found by: 0x3b, 0xbrett8571, 0xmystery, 0xnev, K42, Kral01, Sathish9098, castle_chain, catellatech, cats, emerald7017, fouzantanveer, foxb868, grearlake, hals, jaraxxus, kaveyjoe, lsaudit, rokinot
34.6879 USDC - $34.69
For a user to participate
10 hours
#0 - c4-pre-sort
2023-09-17T02:11:35Z
raymondfam marked the issue as low quality report
#1 - c4-judge
2023-09-26T17:12:21Z
gzeon-c4 marked the issue as grade-b