Skip to content

Missing Access Control on Privileged Function

SAFE-0006 Access Control Checked automatically by the scanner
1

What goes wrong

A state-changing function that should be restricted (mint, withdraw, setOwner, upgrade) has no authorization modifier, letting any address call it and seize control or funds.

2

How to fix it

the pattern that is safe
function setOwner(address newOwner) external onlyOwner {
    require(newOwner != address(0), "zero");
    owner = newOwner;
}
Parity multisig (2017). Use OpenZeppelin Ownable/AccessControl.
Check your own contract for this

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