The executeScheduledRely function in the code allows any external caller to execute it without proper access control checks. This means that anyone can make themselves a ward on a contract without authorization, which poses a security risk. #757
The executeScheduledRely function in the code allows any external caller to execute it without proper access control checks. This means that anyone can make themselves a ward on a contract without authorization, which poses a security risk.
Proof of Concept:
Without proper access control, an attacker can call the executeScheduledRely function as follows:
Lines of code
https://github.com/code-423n4/2023-09-centrifuge/blob/512e7a71ebd9ae76384f837204216f26380c9f91/src/Root.sol#L75
Vulnerability details
Issue:
The
executeScheduledRely
function in the code allows any external caller to execute it without proper access control checks. This means that anyone can make themselves a ward on a contract without authorization, which poses a security risk.Proof of Concept:
Without proper access control, an attacker can call the
executeScheduledRely
function as follows:This allows the attacker to become a ward on the
targetContract
without authorization.Code Block Examples:
Current Implementation:
Recommended Mitigation:
Explanation:
onlyAuthorized
modifier to restrict access to authorized users.onlyAuthorized
modifier checks if the sender (caller) is authorized based on thewards
mapping.executeScheduledRely
function, we've applied theonlyAuthorized
modifier to ensure that only authorized users can execute it.Assessed type
Access Control