The MembershipFactory
and NativeMetaTransaction
contracts allow Ether to be received but lack mechanisms to withdraw it. This vulnerability leads to locked Ether within the contract, potentially resulting in trapped funds that cannot be accessed or recovered. This issue can severely impact the utility of the contract and reduce the effectiveness of any funds management within the smart contract ecosystem.
The MembershipFactory
and NativeMetaTransaction
contracts do not have any defined methods to transfer Ether out of their respective contract addresses. While these contracts may accumulate Ether through user interactions or fallback functions, there is currently no way to withdraw this Ether, effectively trapping it in the contract.
Affected Line of Code
MembershipFactory: Line 15
NativeMetaTransaction: Line 6
Permanent loss of Ether within the contract, creating irrecoverable locked funds and diminishing contract usability. Given that these contracts lack a function to withdraw Ether, any Ether sent directly or via fallback functions will remain unrecoverable. This vulnerability has a high likelihood of being encountered, especially if users mistakenly send Ether to these contracts, either through misunderstanding or malicious redirection.
Without a withdrawal mechanism, any Ether sent to these contracts, either intentionally or unintentionally, will remain locked indefinitely. This presents several critical issues:
Locked Funds: All Ether received by the contract is trapped, causing a loss for users and potentially accumulating unusable funds within the contract.
Reduced Contract Functionality: In cases where Ether is intended to be used in some operational capacity, such as rewards or funding, this inability to access Ether can limit the contract’s core functionalities.
Usability Risk: This issue can diminish trust in the contract, as any misrouted Ether cannot be recovered, leading to poor user experience and potential financial losses.
Proof of Concept
If a user mistakenly sends Ether to either MembershipFactory
or NativeMetaTransaction
contracts, the Ether becomes irreversibly locked. Here’s a basic demonstration:
A user mistakenly sends Ether directly to the MembershipFactory
contract:
Since the contract lacks a withdrawal mechanism, this Ether is permanently locked.
Manual Review
Add a Withdrawal Function: Implement a withdrawEther
function to allow authorized roles (e.g., DEFAULT_ADMIN_ROLE
) to transfer Ether from the contract. For example:
Ensure Ether Receivability: Implement a receive() function to allow Ether to be received if needed.
Implementing these changes will provide a controlled mechanism for Ether management, ensuring funds are not accidentally locked.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.