It's possible to change the collectionArtistAddress after having the artist sign the collection #562
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-741
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/NextGenCore.sol#L147-L166
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/NextGenCore.sol#L257-L262
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/MinterContract.sol#L380
Vulnerability details
In
NextGenCore::setCollectionData
, once the initialcollectionAdditionalData
is set andartistSigned[_collectionID] == true
, then thecollectionArtistAddress
should not be changed.However, it is possible for
CollectionAdmin
to trick an artist into signing the collection and then assigning a different address to thecollectionArtistAddress
.collectionArtistAddress
is allowed toproposePrimaryAddressesAndPercentages
inNextGenMinterContract
, which sets the addresses that the mint profits are distributed to.So a malicious operator could convince an artist to sign a collection, promote and launch a mint, and then take the profits all for themselves.
The issue stems from the implementation of
NextGenCore::setCollectionData
.It's possible to initialize a collection (passing
_collectionTotalSupply
as 0) with data elements includingcollectionArtistAddress
.Once that's done, it's possible for an artist to sign a collection since:
When the artist has signed, the operator can call
NextGenCore::setCollectionData
and re-initialize thecollectionArtistAddress
, sincecollectionTotalSupply
is still 0.Proof of concept
Add the following test to
hardhat/test
Impact
Artist can be cheated into signing a collection that they do not profit from.
Users can be duped into buying tokens that seem to come from an artist but don't.
Tools Used
Manual Review, Hardhat
Recommended Mitigation Steps
In setCollectionData, if an artist has signed, collectionArtistAddress should not be re-assignable.
A simple solution is to change
collectionAdditionalData[_collectionID].collectionTotalSupply == 0
tocollectionAdditionalData[_collectionID].collectionTotalSupply == 0 && artistSigned[_collectionID] == false
inNextGenCore::setCollectionData
.Assessed type
Other
The text was updated successfully, but these errors were encountered: