Skip to content

[M-05] LiquidityPool.withApproval(): Wards not checked, not allowing authorized admin to call functions #559

Open
@c4-submissions

Description

Lines of code

https://github.com/code-423n4/2023-09-centrifuge/blob/main/src/LiquidityPool.sol#L97-L100

Vulnerability details

Impact

LiquidityPool.sol#L97-L100

modifier withApproval(address owner) {
    require(msg.sender == owner, "LiquidityPool/no-approval");
    _;
}

The withApproval() modifier is supposed to allow an authorized admin designated as ward to call certain specified functions such as withdraw()/redeem()/requestDeposit()/requestRedeem()/decreaseDepositRequest()/decreaseRedeemRequest(). However, there is a lack of check of the wards mapping allowing that to be performed, thus any authorized admin assigned as ward cannot call this functions as intended, breaking logic.

Tools Used

Manual Analysis

Recommendation

modifier withApproval(address owner) {
-   require(msg.sender == owner, "LiquidityPool/no-approval");
+   require(msg.sender == owner || wards[msg.sender] == 1, "LiquidityPool/no-approval");
    _;
}

Assessed type

Context

Metadata

Assignees

No one assigned

    Labels

    Q-17QA (Quality Assurance)Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntaxbugSomething isn't workingdowngraded by judgeJudge downgraded the risk level of this issueduplicate-41grade-blow quality reportThis report is of especially low quality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions