Flow

Sablier
FoundryDeFi
20,000 USDC
View results
Submission Details
Severity: high
Invalid

Unauthorized Admin Transfer Vulnerability in `Adminable` Contract

Summary

The Adminable contract allows the current admin to transfer admin control to a new address through the transferAdmin function. This function is protected by the onlyAdmin modifier, restricting access to the current admin. However, if the admin's private key is compromised, an attacker could transfer admin control to themselves, leading to unauthorized access and potential exploitation of the protocol.

Vulnerability Details

  • Affected Function: transferAdmin(address newAdmin)

  • Access Control: Restricted to the current admin.

  • Risk: If an unauthorized party gains access to the admin's private key, they could execute this function and gain control over the entire protocol.

Impact

The vulnerability could lead to unauthorized control over the protocol, allowing an attacker to manipulate functionalities, steal funds, or disrupt service availability.

Tools Used

Manual Testing

Recommendations

The transferAdmin function incorporating a two-step transfer process. It adds a pendingAdmin variable, requiring the proposed admin to confirm the transfer by calling acceptAdmin.

address public pendingAdmin;
function transferAdmin(address newAdmin) public onlyAdmin {
pendingAdmin = newAdmin;
emit NewAdminProposed(msg.sender, newAdmin);
}
function acceptAdmin() public {
require(msg.sender == pendingAdmin, "Not the proposed admin");
emit IAdminable.TransferAdmin(admin, pendingAdmin);
admin = pendingAdmin;
pendingAdmin = address(0);
}

Explanation:

  1. The ransferAdmin function now only sets a pendingAdmin, allowing the proposed address to confirm by calling acceptAdmin.

  2. The acceptAdmin function ensures that only the pendingAdmin can finalize the transfer.

Updates

Lead Judging Commences

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.