Closed code423n4 closed 2 years ago
https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/lib/utils/Ownable.sol#L63 https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/lib/utils/Ownable.sol#L71-L84
founder can re-gain the ownership of auction and MetadataRenderer.
auction
MetadataRenderer
Specifically, he can first invoke Ownable::safeTransferOwnership to make his another wallet as _pendingOwner.
Ownable::safeTransferOwnership
_pendingOwner
After that, he invokes MetadataRenderer::addProperties or Auction::unpause to transfer the ownership to treasury.
MetadataRenderer::addProperties
Auction::unpause
And at any time he wants (or immediately), he can gain the ownership back by calling Ownable::acceptOwnership.
Ownable::acceptOwnership
It is critical since he can change properties any time (impact the value of NFT), or pause auction any time (lock users' funds).
It is against the purpose of a DAO.
Delete the _pendingOwner when transferOwnership.
transferOwnership
Dup of #414
L
Lines of code
https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/lib/utils/Ownable.sol#L63 https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/lib/utils/Ownable.sol#L71-L84
Vulnerability details
Impact
founder can re-gain the ownership of
auction
andMetadataRenderer
.Specifically, he can first invoke
Ownable::safeTransferOwnership
to make his another wallet as_pendingOwner
.After that, he invokes
MetadataRenderer::addProperties
orAuction::unpause
to transfer the ownership to treasury.And at any time he wants (or immediately), he can gain the ownership back by calling
Ownable::acceptOwnership
.It is critical since he can change properties any time (impact the value of NFT), or pause auction any time (lock users' funds).
It is against the purpose of a DAO.
Recommended Mitigation Steps
Delete the
_pendingOwner
whentransferOwnership
.