Closed c4-submissions closed 11 months ago
141345 marked the issue as sufficient quality report
141345 marked the issue as primary issue
a2rocket (sponsor) disputed
artist can propose addresses and once those addresses are accepted they cannot change. Until an admin approves addresses artists can change them.
alex-ppg marked the issue as duplicate of #722
alex-ppg marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/MinterContract.sol#L380-L411
Vulnerability details
Impact
When an artist adds the primary and secondary addresses as well as their percentages, they need the admin to confirm it. That means that the contract admin wants the limit the values the artist can use. But, with the current setup, the artist can game the system.
They first propose values that are acceptable. After that, the admin sends the confirmation transaction. The artist then frontruns the admin's transaction and proposes new values. The new values are confirmed and the admin isn't able to undo those changes.
Proof of Concept
After the artist proposes the addresses and their percentages, they can call the function again to change the proposed values:
When the admin confirms the proposed values there are no additional checks:
Tools Used
none
Recommended Mitigation Steps
In the
acceptAddressesAndPercentages()
function, include the expected values as parameters and check the current values against them. If they don't match, the function should revert. That will prevent the artist from frontrunning that tx.Assessed type
Other