Closed c4-submissions closed 12 months ago
141345 marked the issue as duplicate of #304
alex-ppg marked the issue as not a duplicate
alex-ppg marked the issue as primary issue
The Warden specifies that excess funds sent during a purchase operation for an NFT are not refunded which directly correlates to issue M-02 of the bot report which has been aptly marked as Medium.
alex-ppg marked the issue as unsatisfactory: Out of scope
alex-ppg marked the issue as unsatisfactory: Out of scope
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/MinterContract.sol#L196 https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/MinterContract.sol#L258 https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/MinterContract.sol#L326
Vulnerability details
Impact
Because of the way the check
require(msg.value >= getPrice(_mintCollectionID), "Wrong ETH");
is structured, users can end up paying more than the actual value of NFT, causing bad user experience for user. There is also no refund for extra value sent to help the UX.Proof of Concept
In the burnToMint function as shown below
The price check does not put an upper bound, means User can pay 1000ETH for a 1ETH NFT with no refund sent
Tools Used
Manual Review
Recommended Mitigation Steps
require(msg.value == getPrice(_mintCollectionID), "Wrong ETH");
instead orAssessed type
ETH-Transfer