Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

enckrish - ClearingHouse.maxDuration can be easily bypassed #281

Closed
github-actions bot opened this issue Jan 27, 2023 · 0 comments
Closed

enckrish - ClearingHouse.maxDuration can be easily bypassed #281

github-actions bot opened this issue Jan 27, 2023 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue

Comments

@github-actions
Copy link

github-actions bot commented Jan 27, 2023

enckrish

medium

ClearingHouse.maxDuration can be easily bypassed

Summary

ClearingHouse.clear enforces a maxDuration for loan requests. In practice, the loan owner can easily bypass this limit by calling Cooler.roll as many times as needed.

Vulnerability Detail

The loan request can be made with a duration less than the maxDuration. ClearingHouse.clear calls Cooler.clear which sets true for Loan.rollable. The owner thus is now able to extend the loan term as much as he wants.

Impact

Loan owners are able to bypass the maxDuration restriction in ClearingHouse.

Code Snippet

https://github.com/sherlock-audit/2023-01-cooler/blob/main/src/aux/ClearingHouse.sol#L58-L86

Tool used

Manual Review

Recommendation

In ClearingHouse.clear, call Cooler.toggleRoll just after the Cooler.clear call.

Duplicate of #215

@github-actions github-actions bot added Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue labels Jan 27, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant