Batch.sol
batch
function uses delegatecall
to execute calls to the current contract. This is risky because it executes the code of another contract in the context of the calling contract, potentially allowing the called contract to manipulate the state of the calling contract unexpectedly.Code Reference:
Impact:
An attacker can exploit the batch function by submitting malicious payloads that alter the contract's state or drain funds.
Delegatecall can lead to vulnerabilities such as reentrancy, especially if the called functions are not properly vetted.
Recommendations:
Implement a whitelist of functions that can be called via the batch
function. This ensures that only trusted functions can be executed.
Alternatively, consider using call
instead of delegatecall
unless the intention is specifically to maintain state across calls.
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.