The _refundETH function transfers ETH to the user before updating their balance to zero. This creates a reentrancy vulnerability because the external call _to.transfer(refundValue) allows the recipient to re-enter the contract before their balance is set to zero. Additionally, the use of .transfer has a fixed gas limit of 2300, which can cause transactions to fail if more gas is required.
The _refundETH function transfers ETH to the user before updating their balance to zero, introducing a reentrancy vulnerability. The external call to _to.transfer(refundValue) allows the recipient to re-enter the contract and call refund() again before their balance is reset. This can lead to an attacker repeatedly draining ETH from the contract. Additionally, the use of .transfer has a fixed gas limit, which could cause transactions to fail if more gas is required.
Attackers can re-enter the contract and repeatedly call refund(), draining the ETH balance.
This can lead to complete depletion of ETH in the contract.
The vulnerability is severe and can cause significant financial loss if exploited.
Foundry
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.