HardhatFoundry
30,000 USDC
View results
Submission Details
Severity: low
Invalid

Upgradeable Contract Not Initialized

File location:

https://github.com/Cyfrin/2024-07-biconomy/blob/9590f25cd63f7ad2c54feb618036984774f3879d/contracts/Nexus.sol#L54

Summary

The vulnerability was discovered in the 'Nexus.sol' contract which is an upgradeable contract. This contract was not initialized properly, which could allow a malicious user to take over the contract.

Vulnerability Details

Upgradable contracts are initialized via an initializer function rather than a constructor. In the 'Nexus.sol' contract, the initialization function is missing, leaving the contract in an uninitialized state. This can be exploited by malicious users to call the initialization function and initialize the contract with their own parameters, allowing them to take full control of the contract.

Impact

Malicious users can take over contracts, change contract logic, and steal assets managed by those contracts. This can cause significant financial loss and undermine the integrity of the contract.

Tools Used

  • Inspection manual

  • Solidity

Recommendations

Code snippet:

contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgradeable {

Fixed:

  • Add an 'initialize' function that uses the initializer modifier to ensure the function can only be called once.

  • Make sure all parent contracts are also initialized correctly in the initialize function.

  • Use OpenZeppelin's 'Initializable' to help manage the initialization process.

Updates

Lead Judging Commences

0xnevi Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

finding-UUPS-upgradeable-uninitialized

Invalid, this issue cannot occur because there is no `initialize()` function within the `Nexus.sol` implementation contract. All initial contract initialization is performed within the constructor.

Support

FAQs

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