DYAD - c0pp3rscr3w3r'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: 172/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/cd48c684a58158de444b24854ffd8f07d046c31b/src/core/VaultManagerV2.sol#L119-L128

Vulnerability details

Impact

Anyone can call deposit for an Id that's owned by someone for amount zero (0). This can prevent withdraw attempts for Id in the same block

Proof of Concept

  • Deposit can be called by any address with a valid id and it'll set idToBlockOfLastDeposit to current block number despite no asset sent.
  function deposit(
    uint    id,
    address vault,
    uint    amount
  ) 
    external 
    isValidDNft(id)
  {
    idToBlockOfLastDeposit[id] = block.number;
    Vault _vault = Vault(vault);
    _vault.asset().safeTransferFrom(msg.sender, address(vault), amount);
    _vault.deposit(id, amount);
  }
  • Here in the withdraw function, we can see that the function reverts if withdraw is done in the same block as a deposit.
  function withdraw(
    uint    id,
    address vault,
    uint    amount,
    address to
  ) 
    public
      isDNftOwner(id)
  {
@>    if (idToBlockOfLastDeposit[id] == block.number) revert DepositedInSameBlock();
 //@audit we revert if the idToBlockOfLastDeposit is in the same block for id
..

Tools Used

manual analysis

Have zero amount checks

Assessed type

DoS

#0 - c4-pre-sort

2024-04-27T11:40:18Z

JustDravee marked the issue as duplicate of #1103

#1 - c4-pre-sort

2024-04-27T11:45:39Z

JustDravee marked the issue as duplicate of #489

#2 - c4-pre-sort

2024-04-29T09:28:40Z

JustDravee marked the issue as sufficient quality report

#3 - c4-judge

2024-05-05T20:38:16Z

koolexcrypto marked the issue as unsatisfactory: Invalid

#4 - c4-judge

2024-05-05T20:39:25Z

koolexcrypto marked the issue as unsatisfactory: Invalid

#5 - c4-judge

2024-05-05T21:35:05Z

koolexcrypto marked the issue as nullified

#6 - c4-judge

2024-05-05T21:35:09Z

koolexcrypto marked the issue as not nullified

#7 - c4-judge

2024-05-08T15:28:04Z

koolexcrypto marked the issue as duplicate of #1001

#8 - c4-judge

2024-05-11T19:50:06Z

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