In ParaSwapUtils.sol, line 24 executes an external call to the to address using to.call(callData). However, there is no validation to ensure that to is not address(0). If to is mistakenly set to address(0), the transaction will revert, potentially leading to denial of service or unintended contract behavior.
Code (Line 24, ParaSwapUtils.sol)
Issue: to.call(callData) is executed without checking if to is address(0).
Risk: If to is zero, the contract execution will revert, which could break critical functionality relying on ParaSwap swaps.
An attacker (or a misconfigured contract) could exploit this issue by setting to = address(0), causing the swap to fail.
Expected Behavior
The transaction will fail due to an invalid call to address(0).
Any dependent operations relying on this swap execution will also fail.
Denial of Service (DoS): If an invalid address is used, swaps cannot be executed, breaking the contract’s intended functionality.
Unexpected Reverts: Calls that rely on to.call(callData) could fail in scenarios where to is mistakenly unset.
Potential Fund Loss: If external integrations assume that swaps will always succeed, unexpected failures could cause liquidity mismanagement.
Manual Review
Add a Zero-Check Before Calling to.call(callData)
Modify the function to ensure to is a valid address before executing the external call
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.
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.