Gas grief possible on unsafe external calls
In Solidity, the use of low-level call
methods can expose contracts to gas griefing attacks. The potential problem arises when the callee contract returns a large amount of data. This data is allocated in the memory of the calling contract, which pays for the gas costs. If the callee contract intentionally returns an enormous amount of data, the gas costs can skyrocket, causing the transaction to fail due to an Out of Gas error.
Now (bool success, )
is actually the same as writing (bool success, bytes memory data)
which basically means that even though the data is omitted it doesn't mean that the contract does not handle it. Actually, the way it works is the bytes data
that was returned from the receiver will be copied to memory. Memory allocation becomes very costly if the payload is big
Malicious actor can launch a gas griefing attack on a relayer
Manual
It's advisable to limit the use of call
when interacting with untrusted contracts, or ensure that the callee's returned data size is capped or known in advance to prevent unexpected high gas costs.
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.