Missing ownership check in memorializePositions
#109
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-488
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Lines of code
https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L170
Vulnerability details
Impact
Anyone can call
memorializePositions
with any user NFT and transfer ownership of any previously approved LP tokens to thePositionManager
contract.memorializePositions
stamps the given NFT with the underlying liquidity positions in a given array of bucket indexes and transfers the LPB to the PositionManager contract, since this function does not check if the caller is the owner of the NFT, the LP tokens may be transfer to thePositionManager
contract at an inappropriate time, impacting the position management strategy of the owner.Proof of Concept
https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L170
Tools Used
Manuel Review
Recommended Mitigation Steps
Add a check to compare the
owner
of the nft against themsg.sender
inmemorializePositions
.Assessed type
Access Control
The text was updated successfully, but these errors were encountered: