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

Weak Access Control on Privileged Operations

Description:
The contract includes several critical functions (e.g., setOwner, setRewardAdmin, addAuthorizedSablierSender, removeAuthorizedSablierSender) that are protected only by the onlyOwner modifier. While this provides a basic level of protection, there is no additional mechanism, such as a time lock or multi-signature requirement, to prevent accidental or malicious use.

Location:

src/FjordStaking.sol

  • setOwner function (Line 347)

  • setRewardAdmin function (Line 352)

  • addAuthorizedSablierSender function (Line 357)

  • removeAuthorizedSablierSender function (Line 361)

Issue:
If the owner's private key is compromised or if the owner accidentally configures the contract incorrectly, it could lead to significant issues, such as the inability to distribute rewards correctly or unauthorized addresses gaining privileges.

Impact:

  • Compromise of the owner's account or incorrect configuration of critical settings could severely disrupt the operation of the staking contract, affecting all users.

Tools used: Manual Review.

Recommendations:
Implement additional safeguards for these critical functions, such as a time lock, multi-signature requirement, or a two-step process for executing these functions.

Potential changes:

  • Introduce a time lock or multi-signature requirement for critical functions.

Changes needed for which line of code:

  • Implementing a Time Lock-

    (Example)

contract FjordStaking is ISablierV2LockupRecipient, ReentrancyGuard {
// ... existing code ...
address public newOwner;
uint256 public transferOwnershipTimestamp;
function setOwner(address _newOwner) external onlyOwner {
if (_newOwner == address(0)) revert InvalidZeroAddress();
newOwner = _newOwner;
transferOwnershipTimestamp = block.timestamp + 2 days; // Set a time lock of 2 days
}
function confirmOwnerTransfer() external {
require(msg.sender == newOwner, "Not new owner");
require(block.timestamp >= transferOwnershipTimestamp, "Time lock not expired");
owner = newOwner;
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 11 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.