The IExchangeRouter
interface includes functions that transfer tokens or Ether to a receiver, such as sendTokens()
, sendWnt()
, claimFundingFees()
, and claimCollateral()
. However, there are no checks to prevent transfers to the zero address (address(0))
, which could lead to lost funds.
This function is also called in in GmxProxy.sol
in GmxProxy.sol
which is potentially causing reentrancy attack through gExchangeRouter.claimFundingFees(...)
Transfers Wrapped Native Tokens (WNT) to receiver.
If receiver == address(0)
, WNT is burned forever.
Transfers arbitrary tokens to receiver.
If receiver == address(0)
, tokens are lost.
claimFundingFees(address[] memory markets, address[] memory tokens, address receiver)
*Sends funding fees to receiver, but does not check if receiver is zero.
Claims collateral and sends it to receiver, but does not validate the receiver address.
Funds Loss: If tokens or Ether are sent to address(0)
, they become irrecoverable, leading to potential financial losses.
Misconfigurations: If a contract accidentally sets address(0)
as a receiver, it could cause unintended fund burns.
Potential Exploits: Some protocols use address(0)
for burn functions, and an attacker could manipulate this behavior to drain funds.
Manual review
Add Zero Address Validation in Implementations
Validate receiver in Claim Functions
Add Tests for Zero Address Edge Cases
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.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
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.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
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.