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

QA Report #67

Open
code423n4 opened this issue Mar 9, 2022 · 0 comments
Open

QA Report #67

code423n4 opened this issue Mar 9, 2022 · 0 comments
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

Title : Missing input validation for values which should not be greater than 1

Impact

Various contracts allow update to some config or parameter values which should be never greater than 1.
The input validation for such a check is missing during these update functions.
In the event such values of greater than 1 are accepted, then it may result in unpredictable behavior or panic.

Proof of Concept

Listed below some of these which should be checked.
#1
Config : max_borrow_factor
Contract : money-market-contracts/contracts/market/src/contract.rs
Function : pub fn update_config(...)
Line 321 :

    if let Some(max_borrow_factor) = max_borrow_factor {
        config.max_borrow_factor = max_borrow_factor;
    }

#2
Config : base_rate
Contract : money-market-contracts/contracts/interest_model/src/contract.rs
Function : pub fn update_config(...)
Line 74 :

    if let Some(base_rate) = base_rate {
        config.base_rate = base_rate;
    }

#3
Config : interest_multiplier
Contract : money-market-contracts/contracts/interest_model/src/contract.rs
Function : pub fn update_config(...)
Line 78 :

    if let Some(interest_multiplier) = interest_multiplier {
        config.interest_multiplier = interest_multiplier;
    }

Recommended Mitigation Steps

Its recommended to add a check that the values for these configs are not more than 1.

@code423n4 code423n4 added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax bug Something isn't working labels Mar 9, 2022
code423n4 added a commit that referenced this issue Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

1 participant