Closed code423n4 closed 1 year ago
https://github.com/code-423n4/2022-12-Stealth-Project/blob/main/maverick-v1/contracts/models/Pool.sol#L87
It seems contract misses to also allow spender who are approved for all transactions by an owner. This will cause DOS for all these users
spender
owner
checkPositionAccess
function checkPositionAccess(uint256 tokenId) internal view { require(msg.sender == position.ownerOf(tokenId) || msg.sender == position.getApproved(tokenId), "P"); }
isApprovedForAll(owner, spender)
Kindly revise the function as shown below:
function checkPositionAccess(uint256 tokenId) internal view { require(msg.sender == position.ownerOf(tokenId) || msg.sender == position.getApproved(tokenId) || isApprovedForAll(position.ownerOf(tokenId), msg.sender), "P"); }
kirk-baird marked the issue as duplicate of #9
For the same reasons as #9 I'm going to downgrade this to QA.
Duplicate of https://github.com/code-423n4/2022-12-Stealth-Project-findings/issues/33
Lines of code
https://github.com/code-423n4/2022-12-Stealth-Project/blob/main/maverick-v1/contracts/models/Pool.sol#L87
Vulnerability details
Impact
It seems contract misses to also allow
spender
who are approved for all transactions by anowner
. This will cause DOS for all these usersProof of Concept
checkPositionAccess
functionisApprovedForAll(owner, spender)
which means even if a spender is allowed for all, still he will be denied access to functions usingcheckPositionAccess
(like transfer liquidity)Recommended Mitigation Steps
Kindly revise the function as shown below: