Agent skill
detecting-memory-corruption
Detects various memory corruption vulnerabilities beyond simple buffer overflows including heap overflow, stack smashing, and double free. Use when analyzing complex memory management, heap operations, or investigating memory safety issues.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/detecting-memory-corruption
SKILL.md
Memory Corruption Detection
Detection Workflow
- Identify memory operations: Find all malloc/free/realloc calls, stack buffer allocations, pointer arithmetic operations
- Trace memory usage: Use
xrefs_toto trace data, track pointer values through code, identify all access patterns - Check bounds: Verify size calculations, check array index validation, assess pointer arithmetic safety
- Assess impact: Can corruption control execution? Is there information disclosure? Can corruption cause DoS?
Key Patterns
- Heap overflow: malloc() followed by unchecked writes, off-by-one errors, integer overflow in size calculations
- Stack smashing: large stack buffer allocations, unchecked array access, variable-length arrays, return address overwrites
- Pointer arithmetic: pointer arithmetic without bounds checking, array indexing with user-controlled indices, out-of-bounds pointer access
- Memory leaks: missing free() after malloc(), reference cycles, exception paths skipping cleanup
Output Format
Report with: id, type, subtype, severity, confidence, location, allocation (function, address, size), corruption (function, address, source), vulnerability, root cause, exploitable, attack scenario, mitigation.
Severity Guidelines
- CRITICAL: Memory corruption allowing code execution
- HIGH: Memory corruption with data corruption or DoS
- MEDIUM: Memory leaks or minor corruption
- LOW: Potential issues with limited impact
See Also
patterns.md- Detailed detection patterns and exploitation scenariosexamples.md- Example analysis cases and code samplesreferences.md- CWE references and mitigation strategies
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
riot-games
Manage Riot Games account, track stats across League, Valorant, and more
parcel
Provides comprehensive guidance for Parcel bundler including zero-configuration setup, asset handling, hot module replacement, and production builds. Use when the user asks about Parcel, needs to set up a build tool quickly, or work with Parcel's automatic configuration.
bbs
Manage issues with The Fold's CAS-native BBS (Bulletin Board System). Use for creating, updating, searching, and tracking issues. Invoke when the user wants to create tickets, find work, check issue status, or manage dependencies.
jito-bundles-and-priority-fees
Master Jito bundles for MEV protection and priority fee optimization on Solana - bundle submission, tip strategies, and transaction landing. Use for trading bots, high-priority transactions, and MEV-aware applications.
observability-monitoring-monitor-setup
You are a monitoring and observability expert specializing in implementing comprehensive monitoring solutions. Set up metrics collection, distributed tracing, log aggregation, and create insightful da
makefile-review
Didn't find tool you were looking for?