# sast-danger-mapper

sast-danger-mapper — a subagent that finds dangerous operations in source files: memory handling, type casts, arithmetic at trust boundaries, resource deallocation.

- subagent · `type=agent` · Claude Code, Cursor, Codex, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop) · ★ 1298 repo stars
- Author: H-mmer
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/H-mmer/pentest-agents/tree/HEAD/.claude/agents/sast-danger-mapper.md
- Updated: 2026-06-12
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/agents/sast-danger-mapper

## What it does

Reads a source file and lists every operation that could turn into a vulnerability if its inputs were attacker-controlled: `memcpy`, `malloc`, size overflows in multiplications, array access without index checks, calls via function pointers. For PHP: `eval`, `unserialize`, `system`, SQL injection via query concatenation, XSS in templates with `{!! $x !!}`, SSRF via `curl_exec` with user-supplied URLs. For Rust: `unsafe` blocks, `transmute`, `.get_unchecked()`.

The job is pattern matching, not exploitability assessment. Works via the `/sast` command in Claude Code, Cursor, Codex and other platforms. The instruction sets a 100-turn limit and local memory.

Uses `Read`, `Bash`, `Write`, `Grep`, `Glob` tools. Missing FFmpeg, Python or external libraries will block file operations.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/agents/sast-danger-mapper.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/sast-danger-mapper.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/sast-danger-mapper.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/H-mmer/pentest-agents/tree/HEAD/.claude/agents/sast-danger-mapper.md

## When to use it
- Locate unsafe `memcpy`, `strcpy`, `sprintf` calls without buffer length checks
- Identify overflows in size calculations via `n * sizeof(T)` and addition
- List SQL injections in `mysqli_query`, `$pdo->query` with concatenation
- Detect unfiltered deserialization in `unserialize`, `pickle.loads`, `yaml.load`
- Compile XSS vectors in `echo $x`, `{!! $x !!}`, `{{ x|raw }}`

## Example prompts
- Run `/sast` on `src/parser.c` and list all `malloc` calls with computed size
- Check `app/Controllers/User.php` for SQL injections and deserialization via `/sast`
- Find all `unsafe` blocks and `.get_unchecked()` calls in `core/network.rs`

## Similar
- [drupal-security](https://affpapa.org/en/nevibecode/skills/drupal-security.md) — skill · 933 installs
- [PHP Security Patterns](https://affpapa.org/en/nevibecode/skills/php-security-patterns.md) — skill · 277 installs
- [sast-scanning](https://affpapa.org/en/nevibecode/skills/sast-scanning.md) — skill · 415 installs
- [security-scanning-security-sast](https://affpapa.org/en/nevibecode/skills/security-scanning-security-sast.md) — skill · ★ 50109 repo stars
- [security-sast](https://affpapa.org/en/nevibecode/commands/security-sast.md) — command · ★ 42780 repo stars
- [security-auditor](https://affpapa.org/en/nevibecode/skills/ovachiever-security-auditor.md) — skill · 784 installs

From the same set: [h-mmer/pentest-agents](https://affpapa.org/en/nevibecode/by/h-mmer/pentest-agents.md) — 43 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
