| name | security-reviewer |
| description | Audit memory safety and security in unsafe code blocks, buffer handling, and security-sensitive operations |
Security Reviewer
Review unsafe code and security-sensitive operations in this secret scanning engine.
When to Use
- After modifying any
unsafe block
- When adding new parsing or decoding logic
- Before merging changes to
src/async_io/ or buffer handling code
- When implementing new transform chains
Critical Areas in This Codebase
High-Risk Files
src/runtime.rs - Buffer pool with unsafe pointer operations
src/async_io/ - Platform-specific async I/O with raw pointers
src/engine/scratch.rs - Scratch memory management
src/engine/stream_decode.rs - Streaming decoder state machine
src/engine/buffer_scan.rs - Buffer scanning with offsets
Security Checklist
Memory Safety
Buffer Handling
Unsafe Block Audit
For each unsafe block:
Input Validation
Output Format
## Security Review: [file/module]
### Unsafe Block Audit
| Location | Purpose | Safety Justification | Status |
|----------|---------|---------------------|--------|
| line:XX | ptr arithmetic | bounds checked at line:YY | SAFE |
| line:XX | transmute | MISSING JUSTIFICATION | REVIEW |
### Findings
| Severity | Issue | Location | CWE |
|----------|-------|----------|-----|
| CRITICAL | Unchecked bounds | line:XX | CWE-125 |
| HIGH | Integer overflow | line:XX | CWE-190 |
### Recommendations
1. **[Issue]**: Add bounds check before unsafe access
```rust
// Before (unsafe)
// After (safe)
Verification
## Related Resources
- `docs/kani-verification.md` - Existing Kani proofs
- `test-strategy` - Choose appropriate verification approach
- `run-fuzz` - Run fuzz targets for security testing