# Skill 039

> 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.

- **Type:** Skill
- **Install:** `agentstack add skill-legendtkl-agentic-skill-router-skill-039`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [legendtkl](https://agentstack.voostack.com/s/legendtkl)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [legendtkl](https://github.com/legendtkl)
- **Source:** https://github.com/legendtkl/agentic-skill-router/tree/main/experiments/dci-compare/skillrouter-skills/skill-039
- **Website:** https://legendtkl.github.io/agentic-skill-router/

## Install

```sh
agentstack add skill-legendtkl-agentic-skill-router-skill-039
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Buffer Overflow Detection

## Detection Workflow

1. **Identify dangerous function calls**: strcpy, strcat, sprintf, gets, memcpy without size checks
2. **Trace data flow**: Use `xrefs_to` from input sources (network, files, user input) to sinks
3. **Verify bounds checking**: For each copy operation, check if source size is validated and destination buffer is sufficient
4. **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

- `patterns.md` - Detailed detection patterns and exploitation scenarios
- `examples.md` - Example analysis cases and code samples
- `references.md` - CWE references and mitigation strategies

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [legendtkl](https://github.com/legendtkl)
- **Source:** [legendtkl/agentic-skill-router](https://github.com/legendtkl/agentic-skill-router)
- **License:** MIT
- **Homepage:** https://legendtkl.github.io/agentic-skill-router/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-legendtkl-agentic-skill-router-skill-039
- Seller: https://agentstack.voostack.com/s/legendtkl
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
