Anyone can call memorializePositions
in PositionManager
#105
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-L172
Vulnerability details
Impact
In the
PositionManager
contract user can call thememorializePositions
function to transfer his LP to the position manager, this will save his LP information and bind it to the NFT. To do this he first needs to mint an NFT for the pool of his choice and then approve a position manager to hold his LP. Ajna doesn't restrict access to thememorializePositions
so anyone can call it and transfer LP to the position manager without the knowledge of the NFT owner.Proof of Concept
Let's say Alice minted a token and approved
PositionManager
to use her LP, but she doesn't have intention to memorize her position right now. This opens up the possibility for the griefer account to callmemorializePositions
on it, causing Alice's liquidity to be transferred to the position manager at the wrong time.Tools Used
Manual review
Recommended Mitigation Steps
Add
_isApprovedOrOwner(msg.sender, tokenId_)
check inmemorializePositions
Assessed type
Access Control
The text was updated successfully, but these errors were encountered: