The StoragePositions new function doesn't validate low and up parameters as it states it should #124
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-149
partial-75
Incomplete articulation of vulnerability; eligible for partial credit only (75%)
🤖_48_group
AI based duplicate group recommendation
sufficient quality report
This report is of sufficient quality
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Lines of code
https://github.com/code-423n4/2024-08-superposition/blob/4528c9d2dbe1550d2660dac903a8246076044905/pkg/seawater/src/position.rs#L29-L39
Vulnerability details
Impact
Parameters could be passed with swapped places and the function will set them.
Proof of Concept
The comments suggest that the function requires the parameters to be in the correct places, but doesn't validate them, so the position can be created with swapped places of up and low price ticks.
Tools Used
Manual Review
Recommended Mitigation Steps
Consider making up and low mutable and swapping the parameters in the beginning of the function if low > up:
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: