omermaksutii/rugproof/inline-assembly
Claude Code and agent skill by omermaksutii/rugproof
- community
Checking that the SKILL.md file is still in the repository.
Detect bugs in inline Yul / assembly — manual memory mismanagement, free-memory-pointer corruption, return-data manipulation, missing return-data-size checks, dirty-bits in narrow types. Activate on any `assembly { … }` block, Yul code, Solady-style assembly usage.
Install
npx vskill@latest install omermaksutii/rugproof/inline-assemblySKILL.md
The same SKILL.md was published earlier as iktok90-design/ai-smart-contract-auditor/inline-assembly.
Inline assembly / Yul auditor
When this applies
- Any
assembly { … }block - Pure Yul contracts
- Solady's heavy use of optimized assembly
- Custom delegatecall wrappers, manual memory copy, custom signature verifiers
- Gas-optimization-driven assembly substitutions of Solidity primitives
Detection patterns
Free-memory-pointer not updated after allocation (HIGH)
After writing memory, update mload(0x40) to past the write.
Memory clobbering via reused scratch space (HIGH)
Yul scratch is 0x00-0x3F. External calls / Solidity assignments may overwrite. Don't store across foreign-code boundaries.
Return data not size-checked (HIGH)
Check returndatasize() before copying.
Dirty high bits in narrow types (HIGH)
A uint8 read from calldata via calldataload has the high 248 bits unmasked. Mask with and(..., 0xff) before comparing.
Returning attacker-controlled memory (HIGH)
Mishandling 0x40 / 0x60 (FMP and zero slot) (HIGH)
Writing to 0x60 (zero slot) is a known footgun — that slot must stay zero. Solidity uses it in mappings.
mstore to slot 0/0x20 not cleared after a call (MEDIUM-HIGH)
Reused scratch leaks data across functions.
Loop bounds in assembly without checks (HIGH)
Easy to write infinite loops or array-bound-violators.
Wrong opcode (callcode, suicide, gas costs) (HIGH)
Legacy opcodes still parseable but deprecated. callcode is the wrong delegatecall; suicide is selfdestruct.
Address pointers larger than 20 bytes (HIGH)
address masked at 20 bytes; assembly users sometimes treat as full 32 bytes and leave dirty bits.
Severity rubric
| Pattern | Severity | |
|---|---|---|
| Free-memory-pointer corruption | High | |
| Unchecked returndatasize | High | |
| Dirty high bits on narrow type | High | |
| Wrong/legacy opcode | High | |
| Writes to 0x60 (zero slot) | High | |
| Reused scratch across foreign call | High | |
| Assembly returning misformatted ABI data | High | |
| Pure-Yul math with no overflow proof | High | |
| Comment-less assembly block in production code | Low (maintainability) |
Remediation patterns
- Prefer audited primitives (OZ, Solady) — don't roll your own assembly.
- Document every assembly block: invariants, memory map, why.
- Always update
mload(0x40)after writes; explicitly zero scratch after use. - Check
returndatasize()beforereturndatacopy. - Mask narrow types:
and(x, 0xff)foruint8,and(x, 0xffff)foruint16, etc. - Test with edge-case inputs (zero-length return, oversize return, dirty high bits).
False-positive notes
- Single-line read of fixed slot (e.g.
chainid(),gasprice(),caller()) is safe. - Solady's published assembly libraries are audited; using them as-is is fine — verify version pinning.
Related
- [[assembly-auditor]] (subagent)
- [[unchecked-calls]]
- [[storage-layout]]
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/inline-assembly/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/inline-assembly)