Skip to content
critical Access Control No SWC entry CWE-912

Backdoor / Hidden Privileged Function

SAFE-0015 Access Control Checked automatically by the scanner
1

What goes wrong

The contract contains an owner-only function that can arbitrarily mint, drain, pause, or rewrite balances — a rug-pull or backdoor capability disguised among normal admin functions.

2

How to fix it

the pattern that is safe
// Remove arbitrary drains; restrict to protocol-fee accounting only,
// behind a timelock + multisig, with events and caps.
function withdrawFees(address to) external onlyOwner whenNotPaused {
    uint256 amt = accruedFees; accruedFees = 0;
    emit FeesWithdrawn(to, amt);
    token.safeTransfer(to, amt);
}
Minimize and timelock admin powers; disclose them.
Check your own contract for this

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