DeFiHardhat
35,000 USDC
View results
Submission Details
Severity: low
Invalid

the `UnripeFacet :: pick` function can be used to steal funds multiple times

Summary

the state variable s.unripeClaimed[token][msg.sender] = true is not checked

Vulnerability Details

user can call the function pick with their max amount they can withdraw wait for it to finish then call it again to make another
withdraw until they drain the contract.

Impact

loss of funds for users and protocol, can also cause a DOS for users who want to make a withdrawal or transfer

Tools Used

manual , fuzz test

Recommendations

add this new line of code

function pick(
address token,
uint256 amount,
bytes32[] memory proof,
LibTransfer.To mode
) external payable nonReentrant {
bytes32 root = s.u[token].merkleRoot;
require(root != bytes32(0), "UnripeClaim: invalid token");
require(!picked(msg.sender, token), "UnripeClaim: already picked");
+ require(s.unripeClaimed[token][msg.sender] ==false, "token Claimed "
bytes32 leaf = keccak256(abi.encodePacked(msg.sender, amount));
require(MerkleProof.verify(proof, root, leaf), "UnripeClaim: invalid proof");
s.unripeClaimed[token][msg.sender] = true;
LibTransfer.sendToken(IERC20(token), amount, msg.sender, mode);
emit Pick(msg.sender, token, amount);
}
Updates

Lead Judging Commences

giovannidisiena Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Informational/Invalid

Support

FAQs

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