MorpheusAI

MorpheusAI
Foundry
22,500 USDC
View results
Submission Details
Severity: medium
Invalid

External addresses can trigger the bridging of overplus due to lack of access control

Summary

The bridgeOverplus function in the provided contract lacks proper access control, enabling any external address to trigger the bridging of overplus. This absence of access control poses a security risk, as it allows unauthorized users to execute this function.

Vulnerability Details

The bridgeOverplus function does not incorporate access control modifiers, meaning that any external entity, including potential attackers, can invoke this function. Without proper access restrictions, the contract becomes vulnerable to exploitation by malicious actors.

Impact

The lack of access control in the bridgeOverplus function allows unauthorized users to trigger the bridging of overplus. This could lead to unintended consequences, including draining funds or disrupting the normal operation of the contract.

Tools Used

Manual code review.

Recommendations

To address this vulnerability, implement access control mechanisms to ensure that only authorized users can execute the bridgeOverplus function. One common approach is to use the OpenZeppelin Ownable contract, which restricts specific functions to be callable only by the contract owner.

Ensure that you include the Ownable library in your contract. This modification ensures that only the owner of the contract can execute the bridgeOverplus function. Adjust ownership as needed based on the desired access control model for your contract.

import "@openzeppelin/contracts/access/Ownable.sol";
contract Contract is Ownable {
// Existing contract code
function bridgeOverplus(
uint256 gasLimit_,
uint256 maxFeePerGas_,
uint256 maxSubmissionCost_
) external onlyOwner payable returns (bytes memory) {
// Existing code
}
// Existing contract code
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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