The refundExecutionFee
function lacks reentrancy protection, allowing an attacker to re-enter the function and manipulate contract state. If a malicious contract is the recipient, it can repeatedly withdraw ETH from the contract before the function completes execution.
This could drain funds and cause unauthorized withdrawals, leading to severe financial loss.
The function sends ETH to the recipient without using ReentrancyGuard
.
If receipient
is a malicious contract, it could execute another call to refundExecutionFee
before the first call completes.
This allows the attacker to repeatedly withdraw funds before the contract updates its balance.
Proof of Concept (PoC) Exploit:
Deploys the vulnerable GmxProxy
contract.
Deploys the ReentrancyAttacker
contract that will exploit the vulnerability.
Funds the GmxProxy
contract with ETH.
Attacker calls refundExecutionFee
and re-enters the function to drain funds.
Malicious Contract (Reentrancy Attacker):
Funds in the contract can be drained using a reentrancy attack.
A malicious contract can repeatedly withdraw ETH before the function execution completes.
No balance tracking or reentrancy protection, leading to severe financial loss.
Manual review, Foundry
Prevents reentrancy attacks by using nonReentrant
.
Ensures transfer succeeds using require(success)
.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.