Rules › Solidity

Privileged function without access control

highSolidityRule sol-missing-access-control

A function that mints, withdraws, upgrades, pauses or changes ownership is public with no modifier or sender check.

Why it matters

Functions that mint, withdraw the treasury, upgrade, pause, set fees, oracles or owners are the keys to the contract. If one is public or external with no modifier and no sender check, anyone can call it. Access-control bugs are consistently the largest category of losses in smart-contract incidents.

Vulnerable

function setOwner(address newOwner) external {
    owner = newOwner;
}

Fixed

function transferOwnership(address newOwner) public override onlyOwner {
    super.transferOwnership(newOwner); // Ownable2Step: the new owner must accept
}

What other tools call it

ToolDetector or reference
Slitherarbitrary-send-eth, suicidal, unprotected-upgrade
Aderyncentralization-risk
SWC registrySWC-105, SWC-106

Check your code

Paste a contract into the in-browser checker, or let the Claude Code plugin scan before every deploy. The quick check for this rule is a pattern match: treat a hit as "look here", and a miss as no guarantee.

Static analysis finds known bug classes; it can't prove code is safe and isn't an audit. Get a professional audit before deploying code that will hold value.