HardhatFoundry
30,000 USDC
View results
Submission Details
Severity: medium
Valid

Anyone can call the fallbackFunction because of missing authorization control

Lines of code

https://github.com/Cyfrin/2024-07-biconomy/blob/9590f25cd63f7ad2c54feb618036984774f3879d/contracts/base/ModuleManager.sol#L72C5-L110

Impact

The lack of authorization control in the fallback function allows anyone to access and execute the fallback handlers. Depending on the fallback handler his can result in unauthorized transactions, data manipulation, or other unintended behaviours, potentially compromising the security and integrity of the smart account.

Proof of Concept

  1. An attacker sends a transaction to the ModuleManager contract with arbitrary data.

  2. The fallback function is triggered due to the unrecognized function selector.

  3. The fallback function routes the call to the corresponding fallback handler without verifying the sender's authorization.

  4. The fallback handler executes the call, potentially leading to unauthorized actions.

Recommended Mitigation Steps

Implement proper authorization control in the fallback function to ensure that only authorized entities can invoke it. This can be achieved by adding a modifier to check the sender's authorization before routing the call to the fallback handler. The existing onlyEntryPointOrSelf modifier could be used or an new modifier also including executorModuls might be appropriate.

Updates

Lead Judging Commences

0xnevi Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-fallback-missing-access-control-module-manager

There is indeed no access control within `fallback()` function which violates ERC7579 spec but the impact shown by all issues is insufficient. Need a better impact description/PoC that exceeds violation of ERC7579 to raise the severity of this issue. There will likely be no exploit for staticcall types, given there is not [state change/funds transfer allowed](https://www.rareskills.io/post/solidity-staticcall), so the possible vulnerability would be in the `CALLTYPE_SINGLE`. If no sufficient proof is provided to show a possible exploit, I will likely invalidate these issues.

Support

FAQs

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