Platform: Code4rena
Start Date: 18/04/2024
Pot Size: $36,500 USDC
Total HM: 19
Participants: 183
Period: 7 days
Judge: Koolex
Id: 367
League: ETH
Rank: 181/183
Findings: 1
Award: $0.02
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: MrPotatoMagic
Also found by: 0x175, 0x486776, 0x77, 0xAkira, 0xAsen, 0xDemon, 0xabhay, 0xblack_bird, 0xlemon, 0xloscar01, 0xtankr, 3docSec, 4rdiii, Abdessamed, AlexCzm, Angry_Mustache_Man, BiasedMerc, Circolors, Cryptor, DMoore, DPS, DedOhWale, Dinesh11G, Dots, GalloDaSballo, Giorgio, Honour, Imp, Jorgect, Krace, KupiaSec, Mrxstrange, NentoR, Pechenite, PoeAudits, Ryonen, SBSecurity, Sabit, T1MOH, TheFabled, TheSavageTeddy, Tychai0s, VAD37, Vasquez, WildSniper, ZanyBonzy, adam-idarrha, alix40, asui, blutorque, btk, c0pp3rscr3w3r, caglankaan, carrotsmuggler, d_tony7470, dimulski, dinkras, djxploit, falconhoof, forgebyola, grearlake, imare, itsabinashb, josephdara, kartik_giri_47538, ke1caM, kennedy1030, koo, lionking927, ljj, niser93, pep7siup, poslednaya, ptsanev, sashik_eth, shaflow2, steadyman, turvy_fuzz, ubl4nk, valentin_s2304, web3km, xyz, y4y, zhaojohnson, zigtur
0.0234 USDC - $0.02
https://github.com/code-423n4/2024-04-dyad/blob/cd48c684a58158de444b24854ffd8f07d046c31b/src/core/VaultManagerV2.sol#L119-L131 https://github.com/code-423n4/2024-04-dyad/blob/cd48c684a58158de444b24854ffd8f07d046c31b/src/core/VaultManagerV2.sol#L143
Detailed description of the impact of this finding.
VaultManagerV2::deposit allows for users to deposit underlying vault assets to the vault, however while doing so it will update a mapping idToBlockOfLastDeposit in order to block multiple transactions from the same ID within one block. A malicious user, however, can manipulate this functionality to intentionally block all function calls with require statements contingent on this mapping, namely VaultManagerV2:: withdraw.
Since zero-value deposits are allowed from ERC20's safeTransferFrom, it is possible for an attacker to block all withdraws from a given NFT ID. Since this would be a DoS targeted at an individual vault ID, rather than all vaults in the protocol, I would classify this as a medium severity vulnerability per below C4 description of severity:
2 — Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.
For the below PoC, we assume that the attacker has retrieved the address and vaultID of the target ahead of time. All public data on mainnet blockchain.
Attacker Identified the id of a digital asset within the vault that is frequently accessed by users. Attacker also retrieves address of deployed vault contract.
Attacker prepares to make a zero-value deposit to the vault.
interface IVaultManager { function deposit(uint, address, uint) external; } contract dyadDOS { // IVaultManager defined in interfaces on github IVaultManager vaultManager; constructor(address vaultManagerAddress) { vaultManager = IVaultManager(vaultManagerAddress); } // Assuming attacker knows target vault contract address associated w/ ID function depositZeroDOS(address vaultContractAddress, uint assetID) public { vaultManager.deposit(assetID, vaultContractAddress, 0); } }
Manual Review.
By requiring that deposit values exceed some small value, or simply zero, we can increase the monetary burden on extended DoS attacks on this protocol. By doing this we can simply make it monetarily unfeasible to execute DoS attacks over a long period of time. It would be important to find a value large enough to significantly hamper malicious actors but small enough to not hinder users.
By gating out transactions within a certain block ID, it is inevitable that DoS attacks will be technically possible through minimum-value deposits despite monetary burden. Depending on implementation, however, this may enable other attack vectors.
DoS
#0 - c4-pre-sort
2024-04-27T11:49:27Z
JustDravee marked the issue as duplicate of #489
#1 - c4-pre-sort
2024-04-29T09:30:11Z
JustDravee marked the issue as sufficient quality report
#2 - c4-judge
2024-05-05T20:38:13Z
koolexcrypto marked the issue as unsatisfactory: Invalid
#3 - c4-judge
2024-05-05T20:39:23Z
koolexcrypto marked the issue as unsatisfactory: Invalid
#4 - c4-judge
2024-05-05T21:19:10Z
koolexcrypto marked the issue as nullified
#5 - c4-judge
2024-05-05T21:19:14Z
koolexcrypto marked the issue as not nullified
#6 - c4-judge
2024-05-08T15:28:15Z
koolexcrypto marked the issue as duplicate of #1001
#7 - c4-judge
2024-05-11T19:50:38Z
koolexcrypto marked the issue as satisfactory
#8 - c4-judge
2024-05-13T18:34:30Z
koolexcrypto changed the severity to 3 (High Risk)