تخطَّ إلى المحتوى
إضافةمستورديحتوي سكربتاتترخيص مشاركة بالمثل

rust-review

Comprehensive Rust security code review with specialized bug-finding agents covering the safe/unsafe boundary, memory safety in unsafe blocks, concurrency, panic-induced DoS, recursion-induced stack overflow, FFI, and async runtime hazards

وصف مستورد لم يراجعه محرر بعد

جاء هذا العنصر من مستودعه الأصلي وفحصناه آلياً فقط، ولم يكتب له محرر وصفاً عربياً بعد. اقرأ محتواه بنفسك قبل أن تعتمد عليه. ولا تُفهرس هذه الصفحة في محركات البحث حتى تُراجَع.

التنزيل

اقرأ هذا قبل أن تنزّل

لا يشغّل تلقين أي شيء من هذا العنصر. لكن ما تنزّله يعمل على جهازك إن شغّلته أنت أو سمحت لكلود كود بتشغيله، فاقرأ الملفات أولاً.

  • في العنصر ملفات سكربت.

الملفات: 86 · الحجم: 434 ك.ب

نزّل ملف ZIP

يحمل الملف ترخيص المصدر الأصلي.

التثبيت

تُثبَّت الإضافات من سوق الإضافات في كلود كود، لا بنسخ الملفات. نزّل الحزمة لتقرأ محتواها وترخيصها.

التعليمات

rust-review

Rust security code review plugin. Bug-class coverage comes from empirical bug-shape research across 245 memory-corruption, 177 unsound safe-API, 150 denial-of-service, and 60 thread-safety advisories in the RustSec Advisory Database (1,078 entries) and audits. Orchestration matches c-review.

Usage

Invoke with /rust-review:rust-review. The skill will prompt for:

  • Threat model (REMOTE / LOCAL_UNPRIVILEGED / BOTH)
  • Worker model (haiku / sonnet / opus)
  • Severity filter (all / medium / high)
  • Scope subpath (optional — defaults to whole repo)

Findings + SARIF are written to $(pwd)/.rust-review-results/<iso-timestamp>/.

Overview

Inputs (AskUserQuestion): threat model, scope subpath (optional), worker model, severity filter.

From these inputs the orchestrator detects Rust capability flags (has_unsafe, has_ffi, has_concurrency, has_async, has_packed_repr, has_fs_io) over the scope and selects clusters from prompts/clusters/manifest.json. Each cluster groups related bug classes anchored on a shared mental model and runs as one parallel worker.

The planner caps each non-consolidated worker at four passes, splitting larger clusters into -1/-2/… chunks; output-heavy clusters can declare a smaller max_passes_per_worker in the manifest (today recursion-dos runs one pass per worker). Consolidated clusters (unsafe-boundary, concurrency-locking) are never chunked — one worker owns the whole cluster so its shared Phase-A inventory is built once and grounds every phase.

Always-on clusters:

  • unsafe-boundary (consolidated) — Unsafe Reachability Analysis (URAPI), transmute misuse, pointer-cast hazards via as (PTRCAST), raw-pointer arithmetic, #[repr(C)] layout, enum discriminant and niche validity (ENUMUB), // SAFETY: documentation rules, debug_assert!-guarded safety invariants.
  • panic-dos — resource exhaustion DoS (RESEXHAUST, P0), unwrap/expect on untrusted input, arithmetic overflow, reachable unreachable!/assert!, vector OOB indexing, non-char-boundary str slicing panics (STRSLICE), reachable RefCell double-borrow panics (REFCELLPANIC).
  • recursion-dos — stack-overflow aborts (uncatchable, distinct from panics) on recursive types: unbounded deserialization depth (serde_yaml/toml/ron/custom Deserialize), recursive Display/Debug/Serialize on attacker-shaped values, implicit Drop of Box<Self>-style chains.
  • error-handling — discarded Results, panics inside Drop, lossy From/Into and as casts, lossy UTF-8 / OS-string / path conversions (LOSSYSTR), unflushed BufWriter swallowing write errors (BUFFLUSH).
  • logic-correctness — Ord/Eq/Hash invariant violations, hostile generic trait impls, closure-panic across unsafe scaffolding, NaN/Inf edge cases, partial-match/case string comparisons (STRCMP), serialize_struct field-count mismatches (SERFIELDS), nondeterminism in replicated state (NONDET), in-collection key mutation (KEYMUT). The hostile-trait (TRAITADV) and closure-panic (CLOSUREPANIC) passes require has_unsafe.
  • static-hygiene — Cargo lint config, MSRV, deprecated APIs (mem::uninitialized).
  • resource-handling — raw file-descriptor double-close and leak (RAWFD), Drop-skipping cleanup via process::exit/mem::forget (DROPSKIP).
  • info-disclosure — pointer/address exposure that defeats ASLR (PTREXPOSE).

Conditional clusters:

  • memory-safety (has_unsafe) — UAF via dangled raw pointer, double-free via ptr::read, invalid-free via assignment-to-uninit, uninitialized-read via premature assume_init, Vec::set_len without slot init (SETLEN), buffer overflow via safe→unsafe index propagation, union variant misread, panic-unsafe custom container drop (PANICUNWIND). The whole cluster is gated on has_unsafe (every memory-safety bug class requires unsafe), so it is omitted entirely for pure safe-Rust crates.
  • concurrency-locking (has_concurrency, consolidated) — MutexGuard double-lock from lexical scope, ABBA ordering, Condvar wait without notifier, channel starvation, Once::call_once reentrancy, signal-handler / callback reentrancy.
  • concurrency-data-race (has_concurrency) — non-atomic atomic sequences, unsafe impl Sync over interior mutability, missing Send/Sync bounds, cross-process shared-memory races, unsynchronized static mut (STATICMUT). The unsafe-sync-impl (UNSAFESYNC) and static-mut (STATICMUT) passes require has_unsafe.
  • ffi-cross-language (has_ffi) — CString::as_ptr dangling, ABI mismatch, #[repr(C)] padding leak, opaque-pointer ownership confusion, FFI-owned-memory drop mismatches, Rust closures across extern "C" without catch_unwind, dyn Trait fat pointers crossing FFI.
  • layout-safety (has_packed_repr) — unaligned references to #[repr(packed)] / wire-format struct fields (PACKEDREF).
  • input-os-safety (has_fs_io) — PathBuf::join path traversal (PATHJOIN), filesystem TOCTOU (TOCTOU).
  • async-runtime (has_async) — blocking calls in async, cancellation-unsafe .await sequences, tokio::select! branch bias.

Same orchestration as c-review: workers spawn foreground (one message per wave of ≤16 workers, after an optional cache primer), write markdown-with-YAML-frontmatter finding files, then a dedup-judge merges duplicates, then an fp-judge assigns fp_verdict / severity / attack_vector / exploitability. A report safety net then runs: SARIF is regenerated unconditionally, and the orchestrator writes REPORT.md itself if the fp-judge failed to.

Architecture

coordinator: write context.md → build_run_plan.py → TaskCreate × M
          → spawn primer (foreground) → spawn M workers (parallel)
          → classify Phase-7 outcomes + write findings-index.txt
          → dedup-judge → fp-judge → report safety net (SARIF + REPORT.md) → return REPORT.md
Subagent typePurposeTool set
rust-review:rust-review-workerRun assigned cluster, write findingsRead, Write, Edit, Bash
rust-review:rust-review-dedup-judgeMerge duplicates (runs first)Read, Write, Edit, Glob
rust-review:rust-review-fp-judgeFP + severity + final reports (runs second)Read, Write, Edit, Bash

In current Claude Code an agent granted Bash is not also granted the dedicated Glob/Grep tools (the harness expects find/grep/rg via Bash). So the worker and fp-judge search and resolve paths with Read/Bash, running the ripgrep-syntax prompt seeds through rg; only the dedup-judge — which holds no Bash — uses Glob.

Output directory layout

Default: $(pwd)/.rust-review-results/<iso-timestamp>/. Contains:

  • context.md — resolved threat model, severity filter, scope, capability flags, Cargo manifest status
  • plan.json — selected clusters + rendered worker spawn prompts (one per parallel worker)
  • worker-prompts/ — verbatim spawn prompts, one per worker (+ optional cache-primer.txt)
  • findings/ — one markdown file per finding (<PREFIX>-NNN.md with YAML frontmatter)
  • findings-index.d/ — per-worker shards listing finding paths (survive an orchestrator crash)
  • findings-index.txt — canonical sorted list of every finding file on disk (reconciled against the shards)
  • run-summary.md — worker outcome table, retry/abort state, judge status
  • dedup-summary.md — Tier 1–3 merge + Tier 4 related summary
  • fp-summary.md — verdict counts and per-primary verdict table
  • REPORT.md — human-readable final report grouped by severity, filtered per severity_filter
  • REPORT.sarif — SARIF 2.1.0 export, idempotent (full overwrite), always written

Not for

  • Pure C / C++ codebases — use c-review instead.
  • Smart contracts (Solana, NEAR, Ink!) — use solana-vulnerability-scanner or the contract-specific skill.
  • Kernel-mode Rust without userspace allocator — coverage is incomplete; flag as advisory only.

References

Authors

الملفات

  • مجلد.claude-plugin530 بايت
    • plugin.json530 بايت
  • مجلدagents75 ك.ب
    • rust-review-dedup-judge.md20 ك.ب
    • rust-review-fp-judge.md23 ك.ب
    • rust-review-worker.md32 ك.ب
  • مجلدprompts172 ك.ب
    • مجلدclusters66 ك.ب
      • async-runtime.md855 بايت
      • concurrency-data-race.md2.6 ك.ب
      • concurrency-locking.md6.9 ك.ب
      • error-handling.md1.6 ك.ب
      • ffi-cross-language.md3.3 ك.ب
      • info-disclosure.md562 بايت
      • input-os-safety.md1.1 ك.ب
      • layout-safety.md572 بايت
      • logic-correctness.md3.8 ك.ب
      • manifest.json11 ك.ب
      • memory-safety.md4.6 ك.ب
      • panic-dos.md6 ك.ب
      • recursion-dos.md5.3 ك.ب
      • resource-handling.md1.5 ك.ب
      • static-hygiene.md746 بايت
      • unsafe-boundary.md16 ك.ب
    • مجلدgeneral106 ك.ب
      • abi-mismatch-finder.md705 بايت
      • adversarial-trait-finder.md1.5 ك.ب
      • arithmetic-overflow-finder.md2.1 ك.ب
      • assertion-reachable-finder.md879 بايت
      • async-blocking-finder.md1.2 ك.ب
      • atomic-race-finder.md1.3 ك.ب
      • buffer-overflow-unsafe-finder.md2.6 ك.ب
      • bufwriter-unflushed-finder.md995 بايت
      • cancel-safety-finder.md1.2 ك.ب
      • cargo-lint-config-finder.md2.4 ك.ب
      • closure-ffi-finder.md3.9 ك.ب
      • closure-panic-finder.md1.1 ك.ب
      • collection-key-mutation-finder.md1.9 ك.ب
      • cstring-dangling-finder.md1.3 ك.ب
      • deprecated-api-finder.md1.9 ك.ب
      • destructor-skip-finder.md1.4 ك.ب
      • double-free-finder.md1.6 ك.ب
      • drop-panic-finder.md973 بايت
      • dyn-trait-ffi-finder.md2.8 ك.ب
      • float-edge-finder.md798 بايت
      • foreign-drop-finder.md2.7 ك.ب
      • invalid-free-finder.md1.2 ك.ب
      • lossy-from-into-finder.md603 بايت
      • lossy-str-conversion-finder.md1.2 ك.ب
      • msrv-mismatch-finder.md401 بايت
      • nondeterminism-finder.md1.6 ك.ب
      • opaque-pointer-finder.md1.9 ك.ب
      • ord-eq-hash-finder.md754 بايت
      • out-of-bounds-index-finder.md727 بايت
      • packed-field-ref-finder.md3.7 ك.ب
      • panic-unwind-unsafe-finder.md3 ك.ب
      • path-traversal-join-finder.md1.7 ك.ب
      • pointer-exposure-finder.md1.8 ك.ب
      • raw-fd-lifecycle-finder.md2 ك.ب
      • recursive-deserialize-stack-overflow-finder.md4.8 ك.ب
      • recursive-drop-stack-overflow-finder.md2.7 ك.ب
      • recursive-format-stack-overflow-finder.md4.1 ك.ب
      • refcell-borrow-panic-finder.md1.2 ك.ب
      • repr-c-padding-finder.md2.2 ك.ب
      • resource-exhaustion-finder.md2.4 ك.ب
      • result-discarded-finder.md1.6 ك.ب
      • select-bias-finder.md1.2 ك.ب
      • send-sync-bounds-finder.md2.6 ك.ب
      • serialize-struct-mismatch-finder.md2.3 ك.ب
      • shared-memory-race-finder.md2.8 ك.ب
      • static-mut-race-finder.md2.8 ك.ب
      • str-slice-boundary-finder.md1 ك.ب
      • string-comparison-finder.md1.4 ك.ب
      • toctou-finder.md1.3 ك.ب
      • uninitialized-read-finder.md1.8 ك.ب
      • union-ub-finder.md3.5 ك.ب
      • unsafe-sync-impl-finder.md3.7 ك.ب
      • unwrap-on-untrusted-finder.md1.3 ك.ب
      • use-after-free-finder.md2.9 ك.ب
      • vec-set-len-uninit-finder.md2.5 ك.ب
  • مجلدscripts116 ك.بسكربت
    • build_run_plan.py24 ك.بسكربت
    • generate_sarif.py23 ك.بسكربت
    • pyproject.toml220 بايت
    • test_gating.py13 ك.بسكربت
    • test_generate_sarif.py19 ك.بسكربت
    • test_prompt_regexes.py4.3 ك.بسكربت
    • test_split.py10 ك.بسكربت
    • test_validate_artifacts.py10 ك.بسكربت
    • validate_artifacts.py11 ك.بسكربت
  • مجلدskills43 ك.ب
    • مجلدrust-review43 ك.ب
      • SKILL.md43 ك.ب
  • LICENSE20 ك.ب
  • README.md8.2 ك.ب

ما وجده الفحص الآلي

فحصنا الملفات آلياً وقت الاستيراد. هذا ما نبّه إليه الفحص، ولا يعني أن العنصر ضار ولا أنه سليم: اقرأه بنفسك.

  • يحتاج مراجعةملف سكربت

    في الملف plugins/rust-review/scripts/build_run_plan.py

التعليقات (0)

لا تعليقات بعد. كن أول من يعلّق.

سجّل الدخول لتعلّق. التعليق من المستوى 1 (عضو).

أبلغ

عناصر مشابهة

  • إضافةمستورد

    api-scaffolding

    REST and GraphQL API scaffolding, framework selection, backend architecture, and API generation

    MITالملفات: 8

  • إضافةمستورد

    backend-api-security

    API security hardening, authentication implementation, authorization patterns, rate limiting, and input validation

    MITالملفات: 3

  • إضافةمستورديحتوي سكربتات

    backend-development

    Backend API design, GraphQL architecture, workflow orchestration with Temporal, and test-driven backend development

    MITالملفات: 38

  • إضافةمستورد

    csharp-lsp

    C# language server for code intelligence

    Apache-2.0الملفات: 3

  • إضافةمستورد

    dotnet-contribution

    Comprehensive .NET backend development with C#, ASP.NET Core, Entity Framework Core, and Dapper for production-grade applications

    MITالملفات: 9

  • إضافةمستورد

    functional-programming

    Functional programming with Elixir, OTP patterns, Phoenix framework, and distributed systems

    MITالملفات: 3