dragonked2 / code-audit
Deep code audit for vulnerabilities: taint analysis, data flow tracing, unsafe patterns, race conditions, and memory safety issues.
0
SKILL.md1.5 KB
Code Audit Skill
Deep source code security review.
Taint Analysis Process
- Source Inventory — all entry points where external data enters
- Sink Inventory — all dangerous operations (exec, query, render, deserialize)
- Flow Tracing — follow data from source to sink through all transformations
- Validation Check — is there adequate sanitization at each sink?
- Exploitability — can an attacker control the tainted data?
Language-Specific Patterns
Rust
unsafeblocks: audit every one for correctnessunwrap()in production paths: can panic on bad inputtransmute: type confusion, undefined behaviorString::from_utf8_unchecked: invalid UTF-8 can crash later
JavaScript/TypeScript
eval(),Function(): code injectioninnerHTML,document.write: XSSchild_process.exec: command injection- Prototype pollution via
__proto__
Python
pickle.loads: arbitrary code executionos.system,subprocess.call(shell=True): command injectionyaml.loadwithoutLoader=SafeLoader: deserialization- SQL string formatting: SQL injection
Race Conditions
- TOCTOU: check-then-act on shared state
- Double-spend: concurrent requests exploiting same resource
- Missing locks on shared mutable state
- Non-atomic read-modify-write sequences