Sandclock contest - pedroais'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: 15/33

Findings: 3

Award: $1,159.81

🌟 Selected for report: 1

πŸš€ Solo Findings: 0

Findings Information

Awards

90.0579 USDC - $90.06

Labels

bug
duplicate
3 (High Risk)

External Links

Handle

pedroais

Vulnerability details

Impact

Dangerous external calls in the middle of various state changes could cause reentrancy issues since there is no reentrancy guard in any functions.

Proof of Concept

When users call the deposit or sponsor functions a deposit NFT is minted. The _safeMint() function that's used makes an unsafe external call to the receiver contract that could reenter any function of the protocol.

https://github.com/code-423n4/2022-01-sandclock/blob/a90ad3824955327597be00bb0bd183a9c228a4fb/sandclock/contracts/vault/Depositors.sol#L53

The safe mint function calls _checkOnERC721Received which will make an external call to the contract receiving the NFT.

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/3458c1e8541ce0a0cd935828c9db8f9cbca988a0/contracts/token/ERC721/ERC721.sol#L263

An example of safeMint being used for reentrancy can be found in this blog post by samczsun : https://www.paradigm.xyz/2021/08/the-dangers-of-surprising-code/

Add reentrancy guard to all public statechanching functions.

#0 - naps62

2022-01-13T12:59:36Z

duplicate of #3

Findings Information

🌟 Selected for report: danb

Also found by: ACai, WatchPug, cmichel, harleythedog, leastwood, palina, pedroais

Labels

bug
duplicate
2 (Med Risk)
sponsor vault

Awards

105.9124 USDC - $105.91

External Links

Handle

pedroais

Vulnerability details

Impact

Users may have to wait more time than predicted to withdraw funds.

Proof of Concept

The vault's funds are distributed between the vault and the investment strategy but withdrawals come only from funds that are currently inside the vault. This means that multiple depositors (or one big depositor) may not be able to withdraw their funds at the same time.

-Alice and bob deposit 100 tokens each so the total balance is 200 -50% of the funds are invested -There are 100 tokens in the vault and 100 in the strategy -If bob withdraws his funds then Alice can't do it anymore and has to wait for her tokens to be brought back to the vault by the admins -This means if you're not one of the firsts to withdraw you may have to wait an arbitrary amount of time (dependant on admins) to get your tokens back

#0 - naps62

2022-01-13T12:13:01Z

@gabrielpoca isn't this actually a duplicate of https://github.com/code-423n4/2022-01-sandclock-findings/issues/76 ?

#1 - gabrielpoca

2022-01-13T12:14:32Z

nope, they are different issues, but this is the one I was looking for, ty!

#2 - gabrielpoca

2022-01-14T10:35:57Z

actually, you are correct

Findings Information

🌟 Selected for report: 0x1f8b

Also found by: hubble, leastwood, pedroais

Labels

bug
duplicate
1 (Low Risk)
sponsor vault

Awards

107.6181 USDC - $107.62

External Links

Handle

pedroais

Vulnerability details

Impact

The deposit amount could be 0

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

Require amount != 0

#0 - naps62

2022-01-13T19:59:28Z

duplicate of #155

#1 - dmvt

2022-01-28T23:50:12Z

duplicate of #64

Findings Information

🌟 Selected for report: pedroais

Labels

bug
1 (Low Risk)
disagree with severity
sponsor vault

Awards

590.4972 USDC - $590.50

External Links

Handle

pedroais

Vulnerability details

Impact

The claiming percentage can be set to 0 for a claimer https://github.com/code-423n4/2022-01-sandclock/blob/a90ad3824955327597be00bb0bd183a9c228a4fb/sandclock/contracts/Vault.sol#L420

Require claim.ptc != 0

#0 - naps62

2022-02-15T17:52:41Z

Findings Information

🌟 Selected for report: shenwilly

Also found by: pedroais

Labels

bug
duplicate
1 (Low Risk)
sponsor vault

Awards

265.7237 USDC - $265.72

External Links

Handle

pedroais

Vulnerability details

Proof of Concept

https://github.com/code-423n4/2022-01-sandclock/blob/a90ad3824955327597be00bb0bd183a9c228a4fb/sandclock/contracts/vault/IVault.sol#L74

The description for the underlying() and minLockPeriod() is the same

#0 - gabrielpoca

2022-01-13T23:56:00Z

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