DYAD - ubl4nk's results

The first capital efficient overcollateralized stablecoin.

General Information

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

DYAD

Findings Distribution

Researcher Performance

Rank: 159/183

Findings: 1

Award: $0.02

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2024-04-dyad/blob/4a987e536576139793a1c04690336d06c93fca90/src/core/VaultManagerV2.sol#L127 https://github.com/code-423n4/2024-04-dyad/blob/4a987e536576139793a1c04690336d06c93fca90/src/core/VaultManagerV2.sol#L143

Vulnerability details

Impact

Attacker can DoS the VaultManagerV2::deposit function and the dNFT owner will be unable to withdraw.

Proof of Concept

  • dNFT owner calls withdraw:
function withdraw(
    uint    id,
    address vault,
    uint    amount,
    address to
  ) 
    public
      isDNftOwner(id)
  {
    if (idToBlockOfLastDeposit[id] == block.number) revert DepositedInSameBlock();

it is checking if any amount is deposited into any vault of this dNFT in the same block, then it reverts the transaction (this mean deposit/withdraw can't happen in the same block).

  • Attacker front-runs the dNFT-owner transaction and calls deposit and deposits 1 wei of the vault asset, so the idToBlockOfLastDeposit[id] will be updated.
  • dNFT owner's transaction will be reverted.
  • Attacker can repeat this task for many hours/days/weeks/etc.

Tools Used

Manual Review

Consider adding a minimum limit for deposit amount.

Assessed type

DoS

#0 - c4-pre-sort

2024-04-27T11:58:12Z

JustDravee marked the issue as duplicate of #489

#1 - c4-pre-sort

2024-04-29T09:31:34Z

JustDravee marked the issue as sufficient quality report

#2 - c4-judge

2024-05-05T20:42:46Z

koolexcrypto marked the issue as unsatisfactory: Invalid

#3 - c4-judge

2024-05-05T20:43:20Z

koolexcrypto marked the issue as unsatisfactory: Invalid

#4 - c4-judge

2024-05-05T20:45:38Z

koolexcrypto marked the issue as unsatisfactory: Invalid

#5 - c4-judge

2024-05-05T21:56:29Z

koolexcrypto marked the issue as nullified

#6 - c4-judge

2024-05-05T21:56:33Z

koolexcrypto marked the issue as not nullified

#7 - c4-judge

2024-05-08T15:26:30Z

koolexcrypto marked the issue as duplicate of #1001

#8 - c4-judge

2024-05-11T19:48:32Z

koolexcrypto marked the issue as satisfactory

#9 - c4-judge

2024-05-13T18:34:30Z

koolexcrypto changed the severity to 3 (High Risk)

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter