omermaksutii/rugproof/initialization
Claude Code and agent skill by omermaksutii/rugproof
- community
Checking that the SKILL.md file is still in the repository.
Detect initialization bugs in upgradeable contracts — missing `_disableInitializers()`, re-init attacks, parent-init not chained, constructor-vs-initializer confusion, public `initialize`. Activate on OZ Upgradeable, UUPS, Transparent proxy, Initializable, or any contract with `initialize` / `__init`.
Install
npx vskill@latest install omermaksutii/rugproof/initializationSKILL.md
The same SKILL.md was published earlier as iktok90-design/ai-smart-contract-auditor/initialization.
Initialization detection
When this applies
- OZ
Initializable/*Upgradeablecontracts - Custom upgradeable contracts with
initialize()functions - Beacon proxies, UUPS, Transparent — all flavors
- Factory-deployed clones (EIP-1167 minimal proxies)
- Any deploy script that uses
delegatecallfor setup
Detection patterns
Implementation contract not init-locked (CRITICAL)
Anyone can call initialize on the implementation address directly. Fix:
Public initializer on deployed proxy (CRITICAL)
Proxy deployment script forgets to call initialize atomically → attacker calls it first → owns the contract. Fix: deploy + initialize in same tx via factory or initializer-on-deploy proxy.
Re-init via reinitializer(N) accessible to anyone (HIGH)
Add onlyOwner or onlyProxyAdmin.
Parent init not called (HIGH)
Verify every parent's __X_init() is chained.
Logic in constructor instead of initializer (HIGH for upgradeable)
Upgradeable contracts must do setup in initialize, not constructor.
Constructor runs on proxy (incorrect mental model) (MEDIUM)
Devs sometimes write constructor logic expecting it to run on the proxy. It doesn't — constructor runs at deployment of the implementation, and the proxy never re-runs it.
Clones (minimal proxies) without per-clone init guard (HIGH)
EIP-1167 clones share implementation; each clone's _initialized slot starts at 0. If initialize has no auth, anyone can initialize a fresh clone before the deployer.
Re-init via storage-slot manipulation (HIGH)
OZ v4: _initialized is uint8; v5: _initialized is uint64. Custom upgradeable contracts that don't use OZ may have bypassable guards.
Severity rubric
| Pattern | Severity | |
|---|---|---|
| Implementation init not disabled (anyone owns impl) | Critical | |
| Deployed proxy with public init un-called | Critical | |
| Re-initializer with no auth | High | |
| Clones with no atomic init | High | |
Parent __init missing → broken inheritance | High | |
| Constructor used instead of initializer (upgradeable) | High | |
| Initializer parameter validation missing (e.g. zero-address admin) | Medium | |
| Initial state value seems wrong (defaults to 0) | Medium |
Remediation patterns
- Implementation constructor:
_disableInitializers(). - Deploy proxy + call initializer atomically (single factory tx).
- Mark
initializeasinitializer,reinitializeasreinitializer(N)with auth. - Chain every parent's
__X_init()in order matching inheritance. - For clones: use a factory that deploys-and-initializes in one call.
- Test: from a fresh deploy, attempt
initialize()twice and from a non-admin EOA — both should revert.
False-positive notes
- Non-upgradeable contracts that just happen to use
initializeas a name — not the same pattern. Initializableused purely as a one-shot setup guard with no proxy involved — lower severity.
Related
- [[storage-layout]]
- [[access-control]]
- [[delegatecall-risks]]
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/initialization/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/omermaksutii/rugproof/initialization)