Skip to content
medium Logic / State No SWC entry CWE-841

State Not Reset After Use (Action Replay)

SAFE-0250 Logic / State Checked automatically by the scanner
1

What goes wrong

A one-shot action leaves its enabling state set (an approval, a pending request, an open round) after execution. The action can be repeated because the guarding flag was never cleared.

2

The vulnerable pattern

proof of concept — how it is exploited
// executeRequest(id) runs but leaves requests[id].active = true.
// caller re-runs executeRequest(id) -> the payout happens again.
3

How to fix it

the pattern that is safe
delete pendingRequest[id];   // clear before/after executing
_execute(id);
Clear one-shot state as part of the action.
Check your own contract for this

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