Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 760 Bytes

File metadata and controls

13 lines (9 loc) · 760 Bytes

Insufficient Gas Griefing

Description:

Insufficient gas griefing attacks can be performed on contracts that accept data and use it in a sub-call on another contract. If the sub-call fails, either the whole transaction is reverted, or execution is continued. In the case of a relayer contract, the user who executes the transaction, the 'forwarder', can effectively censor transactions by using just enough gas to execute the transaction, but not enough for the sub-call to succeed.

Remediation:

There are two options to prevent insufficient gas griefing:

  • Only allow trusted users to relay transactions.
  • Require that the forwarder provides enough gas.

References:

https://swcregistry.io/docs/SWC-126