The withdrawWinnings
function
should allow declared winners to withdraw
their prize money by transferring ETH from the
contract to the winner's address, then
clearing their pendingWinnings balance.
When the ETH transfer fails
(due to the recipient being a contract without
a receive/fallback function, or a contract
that rejects ETH transfers), the entire
transaction reverts, leaving the winner's
funds permanently locked in pendingWinnings
with no alternative withdrawal mechanism or
admin recovery function available.
Likelihood:
Users deploy smart contracts to interact
with games without implementing
receive/fallback functions, which is a common
development oversight
Malicious actors can intentionally deploy
contracts that reject ETH transfers after
winning to permanently lock funds from all
participating players
Impact:
Winner's prize money becomes permanently
unrecoverable, affecting funds contributed by
all players in that round
Contract accumulates stuck funds over time
with no admin recovery mechanism, reducing the
effective prize pool for future legitimate
winners
The following PoC demonstrates how funds can be accidentially locked in the game contract. The test and additial smart contract should be placed in the Game.t.sol
file.
Consider to implement an admin recovery function to handle
stuck funds. This allows the contract owner to redirect
stuck funds to a new address (such as an EOA
controlled by the original winner) when
withdrawal failures occur.
Centralization Risk: This approach introduces
admin control over user funds, which creates a
single point of failure and requires users to
trust the contract owner. Consider
implementing additional safeguards such as a
time delay, multi-signature requirements, or
community governance for fund recovery
decisions to mitigate centralization concerns.
The only party affected is the "attacker". Info at best.
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.