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/string-comparison-finder.md
View on GitHub---
name: string-comparison-finder
description: Detects security decisions that use substring/prefix/suffix predicates where full equality is required, or mix case-sensitivity inconsistently
---
**Finding ID Prefix:** `STRCMP`.
**Bug shape:** A security or routing decision calls `starts_with`/`ends_with`/`contains` where full `==` equality is required, enabling bypass (e.g. allowlist check on `"/admin"` matches `"/admin-public"`). Alternatively, case-sensitive `==` and case-insensitive `eq_ignore_ascii_case` are mixed across the same value class (host, path, file extension), creating path confusion.
**Gates:**
1. The comparison gates a security-relevant decision: auth check, allowlist/denylist, host/origin validation, file-extension filter, routing.
2. It uses a substring/prefix/suffix predicate (`starts_with`, `ends_with`, `contains`) where exact identity is required, OR mixes case-sensitive and case-insensitive comparisons inconsistently across equivalent checks.
**FPs:**
- Prefix/suffix match is the explicitly intended semantics (e.g. MIME-type prefix, path hierarchy traversal).
- Inputs are pre-normalized to a canonical form before comparison.
- Comparison is non-security display or formatting logic.
**Patch:** Use `==` or `.eq()` for identity decisions; normalize case uniformly via `eq_ignore_ascii_case` or `.to_lowercase()` and document the chosen semantics.
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: 470k | 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: 470k | 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: 470k | 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 |