Beginner FriendlyFoundryBridge
100 EXP
View results
Submission Details
Severity: low
Invalid

Misleading Use of `enabled` Parameter in `setSigner` Function

Vulnerability Details

The issue identified lies within the setSigner function in the L1BossBridge contract, specifically concerning the use of the enabled boolean parameter. This parameter is intended to enable or disable the status of a signer. However, the naming and implementation of this parameter can be misleading. The function allows setting the enabled parameter to false, which implies the ability to disable a signer. However, this action contradicts the parameter's name and can lead to confusion about its actual functionality.

contract L1BossBridge is Ownable, Pausable, ReentrancyGuard {
...
mapping(address => bool) public signers;
function setSigner(address account, bool enabled) external onlyOwner {
signers[account] = enabled;
}
...
}

Impact

While this issue does not pose a direct security threat to the contract's functionality, it can lead to operational errors or misunderstandings. If an administrator misinterprets the purpose of the enabled parameter, they might inadvertently disable a signer when the intention was to enable them, or vice versa. This confusion can affect the contract's normal operation, especially in scenarios involving critical actions that rely on signers' permissions.

Recommendations

To resolve this confusion and enhance clarity, the enabled parameter should be renamed to more accurately reflect its dual functionality of enabling and disabling a signer. A more intuitive name could be isActive or isAuthorized. This change would make the function's purpose clearer and reduce the risk of operational errors.

Additionally, adding documentation or comments in the code to explain the parameter's purpose and its possible values (true for enabling, false for disabling) would further prevent misunderstanding.

Revised Code Snippet Suggestion:

contract L1BossBridge is Ownable, Pausable, ReentrancyGuard {
...
mapping(address => bool) public signers;
/**
* @notice Set or unset a signer's status.
* @param account The address of the signer.
* @param isActive Set to `true` to activate or `false` to deactivate the signer.
*/
function setSignerStatus(address account, bool isActive) external onlyOwner {
signers[account] = isActive;
}
...
}

This revision enhances the function's clarity, ensuring that its behavior aligns with the administrators' expectations and reducing the likelihood of operational errors.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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