Sandclock contest - Fitraldys's results

The Next Generation of Wealth Creation.

General Information

Platform: Code4rena

Start Date: 06/01/2022

Pot Size: $60,000 USDC

Total HM: 20

Participants: 33

Period: 7 days

Judge: LSDan

Total Solo HM: 9

Id: 67

League: ETH

Sandclock

Findings Distribution

Researcher Performance

Rank: 30/33

Findings: 1

Award: $90.06

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Awards

90.0579 USDC - $90.06

Labels

bug
duplicate
3 (High Risk)

External Links

Handle

Fitraldys

Vulnerability details

Impact

When interacting with the vault contract, the user can call the deposit function, however this can be used to reenter this function because the deposit function will eventually call depositors.mint and in the mint function inside depositors will call _safeMint which belong to erc721, this _safeMint function will call _checkOnERC721Received which will make an external call to the user malicous contract, and the malicious user can reenter the deposit function, with totalShare value bigger than the previous call, because https://github.com/code-423n4/2022-01-sandclock/blob/main/sandclock/contracts/Vault.sol#L470 claimers.mint is called first to increase the share, then the depositors.mint that make the external call, and with this vuln, each reenter will increase the totalShare but the underlying balance is still the same, and this will broke the _computeShares, because the transfer is happening after the _createdeposit is finish.

Proof of Concept

https://github.com/code-423n4/2022-01-sandclock/blob/main/sandclock/contracts/Vault.sol#L160

add noreentrant modifier

#0 - r2moon

2022-01-12T14:10:29Z

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