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/str-slice-boundary-finder.md
View on GitHub---
name: str-slice-boundary-finder
description: Detects str range slicing / split_at / truncate at an attacker-controlled byte index that may fall off a UTF-8 char boundary, panicking
---
**Finding ID Prefix:** `STRSLICE`.
**Gates:**
1. Range slice (`&s[a..b]`), `split_at`/`split_at_mut`, or `String::truncate` on a `str`/`String`.
2. The byte index is derived from untrusted input or byte-length arithmetic (taint trace), not from `find`/`char_indices`/`match` on the same string.
3. No boundary proof on the path (`is_char_boundary`, `.get(range).is_some()`, or the string is known ASCII).
**FPs:**
- Index came from `find`/`char_indices`/`split` on the same string (always a valid boundary).
- Already guarded by `is_char_boundary`, or uses `s.get(a..b)`.
- String proven ASCII, or index is `0`/`s.len()`.
**Patch:** use `s.get(a..b)` and handle `None`; or `split_at_checked`; or derive the index from `char_indices()`.
Distinct from `OOBIDX` (integer-index OOB on `Vec`/`[T]`): `STRSLICE` panics *in bounds* when the index lands inside a multi-byte char.
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 |