Skip to content

Gas Griefing via Subcall Gas Forwarding

SAFE-0039 Denial of Service Checked automatically by the scanner
1

What goes wrong

A relayer/forwarder forwards a fixed or insufficient amount of gas to a subcall, or a callee consumes attacker-controlled gas, letting an attacker make required subcalls fail while the outer call still 'succeeds'.

2

How to fix it

the pattern that is safe
(bool ok,) = target.call(data);   // forward enough gas / handle failure
require(ok, "subcall failed");
Forward adequate gas and propagate subcall failure.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0039 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.

Run the scanner See how it is attacked Read the docs