Non-whitelisted owner can also hold/own a troveNFT
The protocol requires a trove owner to be whitelisted when opening a trove, but the trove NFT is freely transferable, so a whitelisted holder can move it to a non-whitelisted address. This lets a non-whitelisted party end up owning a trove, bypassing the intended access restriction.
Submitted by araj, also found by 0xDemon and gesha17
Finding description and impact
When a user opens a trove, troveNFT is minted to owner and it requires the owner to be whitelisted i.e. non-whitelisted owners are not allowed to mint/own the troveNFT.
function openTrove(
address _owner,
uint256 _ownerIndex,
uint256 _collAmount,
uint256 _boldAmount,
uint256 _upperHint,
uint256 _lowerHint,
uint256 _annualInterestRate,
uint256 _maxUpfrontFee,
address _addManager,
address _removeManager,
address _receiver
) external override returns (uint256) {
_requireValidAnnualInterestRate(_annualInterestRate);
IWhitelist _whitelist = whitelist;
if (address(_whitelist) != address(0)) {
@> _requireWhitelisted(_whitelist, _owner);
_requireWhitelisted(_whitelist, msg.sender);
if (_receiver != address(0)) {
_requireWhitelisted(whitelist, _receiver);
}
}
....
}
function onOpenTrove(
address _owner,
uint256 _troveId,
TroveChange memory _troveChange,
uint256 _annualInterestRate
) external {
....
// mint ERC721
@> troveNFT.mint(_owner, _troveId);
....
}
However, this whitelist requirement can be bypassed because troveNFTs are transferable and a whitelisted owner can transfer his troveNFT to a non-whitelisted owner, bypassing the whitelist requirement
Recommended mitigation steps
Override the transferFrom() of troveNFT.sol and add this _requireWhitelisted() for receiver
RedVeil (BitVault) confirmed
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the whitelist check is only applied at trove creation, while the NFT transfer path lacks any recipient whitelist validation.
Impact
A non-whitelisted address could hold and own a trove, defeating the protocol's access restriction on who may participate.
What the attacker needed
A whitelisted account; trove NFT is transferable
How it was found
- A whitelisted user opens a trove, which mints the trove NFT to them.
- That user transfers the trove NFT to a non-whitelisted address.
- The non-whitelisted address now owns the trove despite never passing the whitelist check.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A trove is a record of collateral and debt held in a smart contract, represented by a transferable token. The project wanted only approved (whitelisted) addresses to hold these tokens, and it checked this when a trove was first created. But it never checked the recipient when the token was later transferred, so an approved user could simply hand the token to anyone.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.