Skip to content

Latest commit

 

History

History
16 lines (9 loc) · 752 Bytes

31.md

File metadata and controls

16 lines (9 loc) · 752 Bytes

Gas Griefing (DoS)

Description:

Insufficient gas griefing attacks can be performed on contracts that accept data and use 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.

Reference:

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