sast-danger-mapper — Claude Code subagent: what it does
sast-danger-mapper — a subagent that finds dangerous operations in source files: memory handling, type casts, arithmetic at trust boundaries, resource deallocation.
no license ★ 1,298 updated 2026-06-12
.claude/agents/sast-danger-mapper.mdWhat sast-danger-mapper 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.
What it helps with
- Locate unsafe
memcpy,strcpy,sprintfcalls without buffer length checks - Identify overflows in size calculations via
n * sizeof(T)and addition - List SQL injections in
mysqli_query,$pdo->querywith concatenation - Detect unfiltered deserialization in
unserialize,pickle.loads,yaml.load - Compile XSS vectors in
echo $x,{!! $x !!},{{ x|raw }}
Example prompts for the agent
- Run
/sastonsrc/parser.cand list allmalloccalls with computed size - Check
app/Controllers/User.phpfor SQL injections and deserialization via/sast - Find all
unsafeblocks and.get_unchecked()calls incore/network.rs
How to install sast-danger-mapper
Manually: put the files in place
.claude/agents/sast-danger-mapper.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/sast-danger-mapper.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/sast-danger-mapper.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about sast-danger-mapper
How to install sast-danger-mapper in Claude Code?
Copy the file to .claude/agents/sast-danger-mapper.md.
What does sast-danger-mapper do?
Searches source files for patterns of dangerous operations: memory handling, type casts, eval, system calls, unparameterized SQL, XSS in templates, SSRF via curl_exec. Lists findings without assessing exploitability.
Which languages does sast-danger-mapper support?
C, C++, Rust, Java, Python, Go, PHP. Each language has a defined pattern set: unsafe memory operations, deserialization, injections, calls via pointers.