Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no way to absorb the excess cash into reserves #220

Closed
code423n4 opened this issue Jul 31, 2023 · 5 comments
Closed

There is no way to absorb the excess cash into reserves #220

code423n4 opened this issue Jul 31, 2023 · 5 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working primary issue Highest quality submission among a set of duplicates sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue unsatisfactory does not satisfy C4 submission criteria; not eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2023-07-moonwell/blob/fced18035107a345c31c9a9497d0da09105df4df/src/core/MErc20.sol#L12

Vulnerability details

Impact

Detailed description of the impact of this finding.
There is no way to absorb the excess cash into reserves

Proof of Concept

Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
Supply caps were taken from this PR, but there is other part internalCash is not being implemented. The internalCash and gulp function allows the protocol to efficiently manage its reserves. When the total supplied amount reaches the supply cap, additional funds supplied by users cannot be provided within the lending markets. The "gulp" function absorbs these excess funds into the protocol's reserves, making them available for future use.

    function gulp() external {
        uint256 cashOnChain = getCashOnChain();
        uint256 cashPrior = getCashPrior();

        uint excessCash = sub_(cashOnChain, cashPrior);
        totalReserves = add_(totalReserves, excessCash);
        internalCash = cashOnChain;
    }

compound-protocol/pull/95/files#diff-a4e078ce9296966ff7c709454713a8aff63ae2b262bdd947886afdb86ad007dfR124

Tools Used

Recommended Mitigation Steps

I think the way it has been implemented in PR is for a reason and it should be copied completed and not partly

Assessed type

Other

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Jul 31, 2023
code423n4 added a commit that referenced this issue Jul 31, 2023
@c4-pre-sort
Copy link

0xSorryNotSorry marked the issue as primary issue

@c4-pre-sort c4-pre-sort added the primary issue Highest quality submission among a set of duplicates label Aug 3, 2023
@ElliotFriedman
Copy link

compound does not have a gulp function. donated tokens that aren't donated using add to reserves just increase the share price.

@c4-sponsor
Copy link

ElliotFriedman marked the issue as sponsor disputed

@c4-sponsor c4-sponsor added the sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue label Aug 3, 2023
@c4-judge
Copy link
Contributor

alcueca marked the issue as unsatisfactory:
Insufficient proof

@c4-judge c4-judge added the unsatisfactory does not satisfy C4 submission criteria; not eligible for awards label Aug 12, 2023
@alcueca
Copy link

alcueca commented Aug 12, 2023

No proof of a vulnerability actually existing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working primary issue Highest quality submission among a set of duplicates sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue unsatisfactory does not satisfy C4 submission criteria; not eligible for awards
Projects
None yet
Development

No branches or pull requests

6 participants