Detailed description of the impact of this finding.
Its possible to force users to buy options
Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
On the flashloan call executeOperation there is no protection that currect contract called flashloan thus its possible to force any users to buy options
Whenever anyone calls buyOptions his msg.sender is encoding and later decoding in a callback executeOperation
Lines of code
https://github.com/code-423n4/2023-08-goodentry/blob/71c0c0eca8af957202ccdbf5ce2f2a514ffe2e24/contracts/PositionManager/OptionsPositionManager.sol#L39
Vulnerability details
Impact
Detailed description of the impact of this finding. Its possible to force users to buy options
Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept. On the flashloan call
executeOperation
there is no protection that currect contract called flashloan thus its possible to force any users to buy optionsWhenever anyone calls
buyOptions
hismsg.sender
is encoding and later decoding in a callbackexecuteOperation
OptionsPositionManager.sol#L161
But anybody can create a same function, but with this difference since there is no validation in a flashloan callback that address(this) is a caller
Tools Used
Recommended Mitigation Steps
Assessed type
Invalid Validation