/viperclaw:viper-rust-memory-unsafefrom viperclaw
Audits Rust code for memory safety issues in unsafe blocks, FFI boundaries, Send/Sync soundness, and release-mode integer overflow. Models checks on RustSec, Rudra, and Clippy security lints.
Ships in viperclaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
unsafe & Integer Safety Auditor (viper-rust-memory-unsafe)undocumented_unsafe_blocks.flowchart LR
Input["Untrusted Slice / Offset"] --> Math["checked_add / usize::try_from"] --> Safe["Bounds-Checked .get() (No unwrap)"] --> FFI["Panic-Safe & Invariant-Verified unsafe"]
viperclaw taint . --db .viperclaw/graph.db
unsafe , std::mem::transmute, from_raw_parts, set_len, as usize, unwrap(), unsafe impl Send, unsafe impl Sync.unsafe Invariant & set_len Auditing: Audit every unsafe block to ensure pointer alignment, non-nullability, lifetime validity, and initialization invariants hold even if a caller-supplied closure panics (Rudra panic-safety pattern; never call Vec::set_len before initializing elements).--release builds, standard +, *, and - wrap silently by default! Use .checked_add(), .saturating_mul(), or overflow-checks = true in Cargo.toml, and use usize::try_from(val) instead of truncating as casts.Send / Sync Soundness: Audit every unsafe impl Send and unsafe impl Sync to confirm interior mutability (UnsafeCell, raw pointers) is protected by atomic operations or locks..unwrap() / .expect() on Untrusted Input: Never call .unwrap(), .expect(), or slice indexing buf[idx] on network-supplied inputs inside request handlers; use .get(idx) and propagate errors with ?.is_null() before dereferencing, catch Rust panics with std::panic::catch_unwind before crossing extern "C" boundaries, and bound buffer lengths.// ❌ VULNERABLE: wraps in release builds & panics on out-of-bounds slice
pub fn read_frame(buf: &[u8], offset: u32, len: u32) -> &[u8] {
let end = (offset + len) as usize;
&buf[offset as usize..end]
}
// ✅ HARDENED: Checked arithmetic and non-panicking slice lookup
pub fn read_frame(buf: &[u8], offset: u32, len: u32) -> Option<&[u8]> {
let start = usize::try_from(offset).ok()?;
let end = start.checked_add(usize::try_from(len).ok()?)?;
buf.get(start..end)
}
RustSec, Rudra, ANSSI Rust Guide, CWE-119, CWE-190| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.0–10.0) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | Unauthenticated remote code execution, cross-tenant authentication or isolation gap, or direct theft of funds/keys. |
| HIGH (7.0–8.9) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N | Authenticated privilege escalation, unauthorized sensitive data exposure, or single-request service outage. |
| MEDIUM (4.0–6.9) | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N | Scoped information disclosure, non-admin state mutation, or configuration weakness requiring user interaction. |
| LOW (0.1–3.9) | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N | Defense-in-depth hardening gap requiring high precondition complexity and minimal direct impact. |
viperclaw taint . --db .viperclaw/graph.db and viperclaw verify to record the verified state in .viperclaw/graph.db.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub zahidoverflow/viperclaw --plugin viperclaw72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas.Other plugins' skills for the same job