Skip to content
medium Token Standards No SWC entry CWE-294

EIP-2612 Permit Misuse / Front-Running

SAFE-0056 Token Standards Checked automatically by the scanner
1

What goes wrong

permit() signatures can be extracted from the mempool and submitted by anyone, or DoS'd by front-running the nonce; integrations that assume the permit caller equals the signer, or do not handle a permit failing because it was already used, can break or be griefed.

2

How to fix it

the pattern that is safe
try token.permit(owner, address(this), v, deadline, vv, rr, ss) {} catch {}
require(token.allowance(owner, address(this)) >= v, "no allowance");
Make permit usage front-run tolerant.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0056 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