Claude-skill-registry detecting-buffer-overflows
Detects stack and heap buffer overflow vulnerabilities in binary code by identifying unsafe memory operations. Use when analyzing buffer handling, string manipulation functions, or investigating memory corruption vulnerabilities.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/detecting-buffer-overflows" ~/.claude/skills/majiayu000-claude-skill-registry-detecting-buffer-overflows && rm -rf "$T"
manifest:
skills/data/detecting-buffer-overflows/SKILL.mdsource content
Buffer Overflow Detection
Detection Workflow
- Identify dangerous function calls: strcpy, strcat, sprintf, gets, memcpy without size checks
- Trace data flow: Use
from input sources (network, files, user input) to sinksxrefs_to - Verify bounds checking: For each copy operation, check if source size is validated and destination buffer is sufficient
- Assess exploitability: Can attacker control overflow size? Is there controlled write to critical memory?
Key Patterns
- Stack overflow: Unbounded copy to local buffer
- Heap overflow: Malloc followed by unchecked write
- Off-by-one: Loop condition or bounds check error
- Integer overflow leading to buffer overflow
Output Format
Report with: id, type (stack/heap/static), severity, confidence, location, sink, source, buffer size, overflow potential, evidence, exploitability, mitigation.
Severity Guidelines
- CRITICAL: Unbounded copy to stack buffer, attacker-controlled size
- HIGH: Bounded copy with insufficient checks, off-by-one errors
- MEDIUM: Potential overflow with limited attacker control
- LOW: Unlikely to be exploitable, theoretical only
See Also
- Detailed detection patterns and exploitation scenariospatterns.md
- Example analysis cases and code samplesexamples.md
- CWE references and mitigation strategiesreferences.md