DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: low
Invalid

Functions calling contracts with transfer hooks are missing reentrancy guards

Summary

Even if the function follows the best practice of check-effects-interaction, not using a reentrancy guard when there may be transfer hooks will open the users of this protocol up to read-only reentrancies with no way to protect against it, except by block-listing the whole protocol.

Vulnerability Details

162 LibShortRecord.transferShortRecord(asset, from, to, uint40(tokenId), nft);

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/ERC721Facet.sol#L162

state change after the call

164 delete s.getApproved[tokenId];

Impact

The impact of not using a reentrancy guard in this context can be significant. It exposes users of this protocol to potential read-only reentrancy attacks without an easy way to protect against them, aside from block-listing the entire protocol. Read-only reentrancy attacks can lead to unauthorized access to contract state and potentially allow malicious actors to exploit vulnerabilities for malicious purposes.

Tools Used

Manual Revew

Recommendations

Add nonreentrancy modifier of OZ or solmate

Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.