NestedFactory.addTokens and withdraw functions require NFT reserve check #199
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
hyh
Vulnerability details
Impact
NFT token operations will fail if wrong reserve is used.
Proof of Concept
NestedFactory
reserve
is used inaddtokens
andwithdraw
function for a given NFT, but the NFT to reserve contract correspondence isn't checked.addtokens:
https://github.com/code-423n4/2021-11-nested/blob/main/contracts/NestedFactory.sol#L119
withdraw:
https://github.com/code-423n4/2021-11-nested/blob/main/contracts/NestedFactory.sol#L241
Recommended Mitigation Steps
Add the
require(nestedRecords.getAssetReserve(_nftId) == address(reserve), "...")
check in the beginning of the functions.The text was updated successfully, but these errors were encountered: