sb-dev/openquant / .agents/skills/rust-review
rust-review
VerifiedReview Rust crates, services, or libraries for safe/unsafe boundary issues, memory safety, concurrency hazards, panic-induced denial of service, FFI safety, and async runtime mistakes. Use for a Rust security audit, especially unsafe, FFI, or concurrent code.
upstream/prompts/general/destructor-skip-finder.md
View on GitHub---
name: destructor-skip-finder
description: Detects process::exit, mem::forget, and ManuallyDrop bypassing Drop for values whose destructor performs security-relevant cleanup
---
**Finding ID Prefix:** `DROPSKIP`.
**Bug shape:** `std::process::exit`/`libc::exit`, `std::mem::forget`, or `ManuallyDrop` bypasses `Drop` for live values whose destructor performs security-relevant cleanup — committing/rolling back, flushing, releasing a lock, or closing a connection. The cleanup silently never runs. (DROPSKIP flags a present `Drop` bypassed by control flow; whether a secret has zeroize-on-drop at all is out of scope — see `zeroize-audit`. Distinct from `RAWFD`, which covers fd-specific lifecycle.)
**Gates:**
1. `process::exit`/`exit`/`mem::forget`/`ManuallyDrop` is reachable while values with a meaningful `Drop` are live (secret, DB/connection handle, transaction guard, lock guard, buffered writer).
2. Skipping that `Drop` has a security or correctness consequence.
**FPs:**
- No live value has a meaningful `Drop` at the skip point.
- The leak/skip is intentional and documented (`// SAFETY:` or equivalent comment) with an explicit handoff.
- Cleanup is performed explicitly before `exit`.
**Patch:** run cleanup explicitly before `process::exit`; avoid `process::exit` in library code; pair `mem::forget`/`ManuallyDrop` with an explicit equivalent cleanup and a justifying comment.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |