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

lending-market/NoteInterest.sol Lack of access control in updateBaseRate() allowing baseRatePerYear to be changed by anyone #165

Closed
code423n4 opened this issue Jun 21, 2022 · 3 comments
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/Plex-Engineer/lending-market/blob/b93e2867a64b420ce6ce317f01c7834a7b6b17ca/contracts/NoteInterest.sol#L118-L129

Vulnerability details

function updateBaseRate(uint newBaseRatePerYear) public {
    // check the current block number
    uint blockNumber = block.number;
    uint deltaBlocks = blockNumber.sub(lastUpdateBlock);

    if (deltaBlocks > updateFrequency) {
        // pass in a base rate per year
        baseRatePerYear = newBaseRatePerYear;
        lastUpdateBlock = blockNumber;
        emit NewInterestParams(baseRatePerYear);
    }
}

Recommendation

Add proper access control.

@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Jun 21, 2022
code423n4 added a commit that referenced this issue Jun 21, 2022
@ecmendenhall
Copy link

Duplicate of #22

@tkkwon1998 tkkwon1998 added the duplicate This issue or pull request already exists label Jun 22, 2022
@tkkwon1998
Copy link
Collaborator

Duplicate of issue #22

@GalloDaSballo
Copy link
Collaborator

Dup of #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants