Ether can be permanently locked within the MembershipERC1155.sol contract. While the contract includes functionality to forward Ether through callExternalContract, it lacks a mechanism to withdraw any Ether that might accumulate in the contract through other means (such as selfdestruct calls from other contracts).
The vulnerability stems from two main issues:
The contract can receive Ether through:
The callExternalContract function which is marked as payable
Force-sending methods (like selfdestruct) from other contracts
The contract lacks:
A withdrawal mechanism for accumulated Ether
Explicit receive() or fallback() functions to handle incoming Ether
Any way to recover Ether that becomes trapped
An attacker can force-send Ether to the contract using selfdestruct
The contract has no mechanism to withdraw this Ether
The Ether becomes permanently locked in the contract
The vulnerability can result in:
Permanent loss of any Ether sent to the contract
No recovery mechanism for accidentally transferred funds
Potential accumulation of locked Ether over time
The impact is considered High because:
It results in permanent loss of funds
There is no workaround once Ether is locked
The issue cannot be fixed without contract redeployment
SolidityScan - Static Analysis Tool
Manual Code Review
Solidity Documentation Reference
If the contract needs to receive Ether:
If the contract should not handle Ether at all:
Remove the payable modifier from callExternalContract
Add checks to prevent Ether reception
Document clearly that the contract should not receive Ether
While the contract's primary purpose may not involve handling Ether directly, the ability to receive Ether without withdrawal capabilities creates an unacceptable risk of permanent fund loss.
The recommended solutions provide multiple options for addressing this vulnerability, with the choice depending on the intended behavior of the contract.
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.