code-423n4 / 2022-01-sandclock-findings

0 stars 0 forks source link

`Vault.sponsor()` Does Not Prevent Sponsoring The Zero Amount #145

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

leastwood

Vulnerability details

Impact

The sponsor() function allows sponsors to parse the zero amount successfully. As a result, a deposit NFT will be minted which provides no functionality to the user.

Proof of Concept

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

Tools Used

Manual code review.

Recommended Mitigation Steps

Consider only allowing users to sponsor the protocol with a positive amount, i.e. _amount != 0.

naps62 commented 2 years ago

Fixed in https://github.com/sandclock-org/solidity-contracts/pull/85