Loan duration can exceed the end of the next epoch
The protocol specification states that new loan durations must not exceed the end of the next epoch, but the implementation does not enforce this restriction. An attacker could create loans with durations longer than allowed, potentially causing miscalculations and fund loss.
Source: https://github.com/sherlock-audit/2022-10-astaria-judging/issues/170
Found by
0xRajeev
Summary
Loan duration can exceed the end of the next epoch, which deviates from the protocol specification.
Vulnerability Detail
From the specs: "The duration of new loans is restricted to not exceed the end of the next epoch. For example, if a PublicVault is 15 days into a 30-day epoch, new loans must not be longer than 45 days."
However, there's no enforcement of this requirement.
Impact
The implementation does not adhere to the spec: Loan duration can exceed the end of the next epoch, which breaks protocol specification and therefore lead to miscalculations and potential fund loss.
Code Snippet
- https://docs.astaria.xyz/docs/protocol-mechanics/epochs
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/VaultImplementation.sol#L146-L228
Tool used
Manual Review
Recommendation
Implement as per specification or revisit the specification.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
Loan duration can exceed the end of the next epoch, which breaks protocol specification and therefore lead to miscalculations and potential fund loss.
What the attacker needed
None
The fix
The code should be changed to enforce the specification's limit on loan duration, or the specification should be revised.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This report is about a rule in a lending protocol that limits how long a new loan can last. The rule says a loan cannot extend past the end of the next epoch (a time period). The code does not check this rule, so someone could take out a loan that lasts too long, which might mess up the protocol's calculations and cause money to be lost.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.