Closed code423n4 closed 1 year ago
GalloDaSballo marked the issue as primary issue
Primary because POC
We are aware of the centralization risks, initially, all contracts will have a multi-sig as owner to prevent a sole owner, later on a DAO could be the owner.
TriHaz marked the issue as sponsor acknowledged
Making dup of #377 as it highlights a centralization risk
GalloDaSballo marked the issue as duplicate of #377
GalloDaSballo marked the issue as satisfactory
Lines of code
https://github.com/code-423n4/2022-12-tigris/blob/main/contracts/GovNFT.sol#L64-L71
Vulnerability details
Impact
After a Governance NFT is minted and transferred to a user on Chain A, this user can bridge it to Chain B. Afterwards, because this NFT is already burned on Chain A, the owner of the
GovNFT
contract, who can possibly become compromised or malicious, can call the followingGovNFT._bridgeMint
function on Chain A to mint the same NFT on Chain A. Later, when the corresponding NFT's holder calls theGovNFT.crossChain
function on Chain B for bridging such NFT from Chain B to Chain A, theGovNFT.lzReceive
function on Chain A is called, which eventually calls theGovNFT._bridgeMint
function on Chain A. However, calling theGovNFT._bridgeMint
function on Chain A for this NFT reverts because the same NFT was minted on Chain A already due to theGovNFT
contract's owner's previousGovNFT._bridgeMint
function call. As a result, the holder of such Governance NFT loses the ability for bridging such NFT from Chain B to Chain A and is not able to earn rewards from the DAO fees generated by the trades on Chain A.https://github.com/code-423n4/2022-12-tigris/blob/main/contracts/GovNFT.sol#L64-L71
Proof of Concept
For example, based on this protocol's deployed contract addresses, querying 55 using https://polygonscan.com/address/0x5DF98AA475D8815df7cd4fC4549B5c150e8505Be#readContract#F14 indicates that Governance NFT id 55 does not exist on Polygon but querying 55 using https://arbiscan.io/address/0x303c470c0e0342a1CCDd70b0a17a14b599FF1474#readContract#F18 indicates that Governance NFT id 55 exists on Arbitrum.
The following test can then be added in the
Crosschain related functions
describe
block intest\05.GovNFT.js
. This test will pass to demonstrate the described scenario. Please see the comments in this test for more details.Tools Used
VSCode
Recommended Mitigation Steps
The
_msgSender() == owner()
require
condition can be removed from https://github.com/code-423n4/2022-12-tigris/blob/main/contracts/GovNFT.sol#L65 to prevent the owner of theGovNFT
contract from arbitrarily minting a Governance NFT.