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

Custom Coffee Fly - updateDownsideProtected can be called by anyone leading to incorrect downside protection records on CDS module #1064

Open
sherlock-admin2 opened this issue Dec 30, 2024 · 0 comments

Comments

@sherlock-admin2
Copy link
Contributor

Custom Coffee Fly

Medium

updateDownsideProtected can be called by anyone leading to incorrect downside protection records on CDS module

Summary

The function updateDownsideProtected can be called by anyone. It's supposed to be called only by the borrowing contract. As such, anyone can change the recorded value of downsideProtected inside the CDS contract, which can lead to incorrect downside protection value to be used on the borrowing contract.

 function updateDownsideProtected(uint128 downsideProtectedAmount) external {
        downsideProtected += downsideProtectedAmount; // @audit anyone can call it to modify the downsideProtected value, any consequence?
    }
    

Root Cause

The function updateDownsideProtected is publicly callable by anyone due to the external keyword.

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

Any one can call it to change this value, which's used inside the borrowing 'contract', leading to incorrect value to be used when user call the withdraw functions.

PoC

No response

Mitigation

Only core contract should be able to call the function updateDownsideProtected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant