sherlock-audit / 2024-04-titles-judging

10 stars 7 forks source link

AhmedAdam - Missing Referrer Checks in Mint Function Allow Minter to Recover Minting Fees #323

Closed sherlock-admin4 closed 5 months ago

sherlock-admin4 commented 5 months ago

AhmedAdam

high

Missing Referrer Checks in Mint Function Allow Minter to Recover Minting Fees

Summary

In the Edition.sol contract's mint function, a minter has the ability to designate themselves as the referrer, resulting in the minter recovering 50% of the minting fees.

Vulnerability Detail

Consider this scenario:

Impact

Manipulating the mint Fee amount.

Code Snippet

https://github.com/sherlock-audit/2024-04-titles/blob/d7f60952df22da00b772db5d3a8272a988546089/wallflower-contract-v2/src/editions/Edition.sol#L228-L242

https://github.com/sherlock-audit/2024-04-titles/blob/d7f60952df22da00b772db5d3a8272a988546089/wallflower-contract-v2/src/fees/FeeManager.sol#L366-L410

Tool used

Manual Review

Recommendation

Implement checks so that the minter is not the same as referrer_ or methods to verify referrers.

Duplicate of #405

WangSecurity commented 4 months ago

This is a duplicate of #405 , not #267