Closed code423n4 closed 1 year ago
berndartmueller marked the issue as primary issue
kyscott18 marked the issue as sponsor acknowledged
We don't support interacting with the protocol without using the periphery contract.
berndartmueller marked the issue as satisfactory
berndartmueller marked the issue as selected for report
I'm reconsidering the severity of the finding. Users are expected to use the provided periphery contract. If they don't and interact directly with the core contracts, it's their responsibility to interact with the system correctly in the intended way. As this incorrect interaction with the protocol does not affect other users (other LPs receive even more rewards), I consider QA (Low) to be the appropriate severity.
berndartmueller marked the issue as not selected for report
berndartmueller changed the severity to QA (Quality Assurance)
berndartmueller marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2023-01-numoen/blob/2ad9a73d793ea23a25a381faadc86ae0c8cb5913/src/core/Lendgine.sol#L194
Vulnerability details
Impact
A user might miss the interests for his position
Proof of Concept
The protocol has a mechanism to accrue interests for liquidity providers according to the current borrow/lending state. Normally LPs interact with the protocol via the functions exposed in
LiquidityManager.sol
. When the functionLiquidityManager.collect()
is called,Lendgine.accruePositionInterest()
is triggered first to update therewardPerPositionStored
.On the other hand, Lendgine also exposes a function
collect()
and it can be called by LPs directly as well. The problem is this function does not callaccruePositionInterest()
and the reward per position is not updated.It is understood that the caller can use MultiCall to call
accruePositionInterest()
and thencollect()
to prevent this. But there still exists a situation, where a user might miss the interests, and this can be mitigated. Because the LPs might miss interests under some conditions, I submit this as a medium level issue.Tools Used
Manual Review
Recommended Mitigation Steps
Update the
Lendgine.collect()
function as below.