Closed sherlock-admin closed 2 years ago
Sense's redeem
method reverts if maturity has not occurred for the market in question. In addition, Sense's PT does not provide a mechanism to check the maturity. As a result, another approach will have to be taken to address Sense's maturity.
ctf_sec
medium
Redeem function for Sense finance does not check the maturity.
Summary
Redeem function for Sense finance does not check the maturity.
Vulnerability Detail
In the redeem function implementation, the code uses a lengthy implementation but accurate implementation to check if the position's maturity
If the position is not matured, the transaction revert before going to redeem:
However, the checking for maturity is missing in Sense redeeming function!
Impact
Redeeming before maturity should not be allowed.
Code Snippet
https://github.com/sherlock-audit/2022-10-illuminate/blob/main/src/Redeemer.sol#L335-L365
https://github.com/sherlock-audit/2022-10-illuminate/blob/main/src/Redeemer.sol#L254-L259
Tool used
Manual Review
Recommendation
After some research, I believe we can check the Sense finance maturity first using the function below
https://github.com/sense-finance/sense-v1/blob/7b37dec129dbf207a2d2ac2469ced7c75b157691/pkg/core/src/adapters/abstract/BaseAdapter.sol#L172
We can get the maturity first and validate the maturity before calling redeem.