Platform: Code4rena
Start Date: 21/08/2023
Pot Size: $125,000 USDC
Total HM: 26
Participants: 189
Period: 16 days
Judge: GalloDaSballo
Total Solo HM: 3
Id: 278
League: ETH
Rank: 149/189
Findings: 2
Award: $3.99
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: klau5
Also found by: 0x3b, 0xCiphky, 0xDING99YA, 0xWaitress, 0xbranded, 0xc0ffEE, 0xklh, 0xsurena, 0xvj, ABA, AkshaySrivastav, Anirruth, Aymen0909, Baki, Blockian, BugzyVonBuggernaut, DanielArmstrong, Evo, GangsOfBrahmin, HChang26, Inspex, Jiamin, Juntao, Kow, Krace, KrisApostolov, LFGSecurity, LokiThe5th, Mike_Bello90, Norah, Nyx, QiuhaoLi, RED-LOTUS-REACH, SBSecurity, Snow24, SpicyMeatball, T1MOH, Tendency, Toshii, Udsen, Yanchuan, __141345__, ak1, asui, auditsea, ayden, bart1e, bin2chen, blutorque, carrotsmuggler, chaduke, chainsnake, circlelooper, clash, codegpt, crunch, degensec, dirk_y, ge6a, gjaldon, grearlake, jasonxiale, juancito, ke1caM, kodyvim, kutugu, ladboy233, lanrebayode77, mahdikarimi, max10afternoon, mert_eren, nirlin, nobody2018, oakcobalt, parsely, peakbolt, pks_, pontifex, ravikiranweb3, rokinot, rvierdiiev, said, savi0ur, sces60107, sh1v, sl1, spidy730, tapir, tnquanghuy0512, ubermensch, visualbits, volodya, wintermute
0.0098 USDC - $0.01
Malicious users can send 1 wei of WETH to PerpetualAtlanticVaultLP
to DOS the PerpetualAtlanticVaultLP.subtractLoss()
function
function subtractLoss(uint256 loss) public onlyPerpVault { require( collateral.balanceOf(address(this)) == _totalCollateral - loss, <@@ CAN DOS THIS EASILY BY DONATION ATTACK "Not enough collateral was sent out" ); _totalCollateral -= loss; }
Manual Review
Change from ==
to >=
in subtractLoss()
function
- collateral.balanceOf(address(this)) == _totalCollateral - loss + collateral.balanceOf(address(this)) >= _totalCollateral - loss
DoS
#0 - c4-pre-sort
2023-09-09T09:56:50Z
bytes032 marked the issue as duplicate of #619
#1 - c4-pre-sort
2023-09-11T16:14:28Z
bytes032 marked the issue as sufficient quality report
#2 - c4-judge
2023-10-20T19:31:26Z
GalloDaSballo marked the issue as satisfactory
🌟 Selected for report: 0xTheC0der
Also found by: 0Kage, 0xDING99YA, 0xHelium, 0xbranded, 836541, ABA, Kow, QiuhaoLi, SpicyMeatball, T1MOH, __141345__, alexfilippov314, ayden, bart1e, bin2chen, chaduke, degensec, jasonxiale, joaovwfreire, nirlin, peakbolt, pep7siup, rvierdiiev, tnquanghuy0512
3.9817 USDC - $3.98
Execute PerpetualAtlanticVault.updateFundingDuration()
make every variables in this contract got affected
If we update fundingDuration
to a bigger value than before, nextFundingPaymentTimestamp()
will be bigger than block.timestamp
, make it DOS in most functions until block.timestamp
surpass nextFundingPaymentTimestamp()
Manual Review
I think fundingDuration
variable should not be change at all, so I'd recommend change the variable to be a constant
Other
#0 - c4-pre-sort
2023-09-08T06:26:01Z
bytes032 marked the issue as duplicate of #980
#1 - c4-pre-sort
2023-09-11T08:20:59Z
bytes032 marked the issue as sufficient quality report
#2 - c4-judge
2023-10-20T11:11:50Z
GalloDaSballo marked the issue as partial-25
#3 - GalloDaSballo
2023-10-20T11:11:52Z
Low quality but valid