zeroize-audit – skill Bảo mật cho agent AI
Phát hiện thiếu xóa an toàn (zeroization) dữ liệu nhạy cảm trong mã nguồn và xác định các lệnh xóa bị trình biên dịch loại bỏ khi tối ưu, bằng phân tích mức assembly và kiểm tra luồng điều khiển. Dùng để kiểm toán mã C/C++/Rust xử lý khóa, mật khẩu hoặc dữ liệu nhạy cảm khác.
Cài skill zeroize-audit bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/zeroize-audit-43278.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /zeroize-audit – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/zeroize-audit-43278.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $zeroize-audit – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/zeroize-audit-43278.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /zeroize-audit – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/zeroize-audit-43278.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /zeroize-audit – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Supporting material availability
This catalog copy contains the inline guidance below, but does not include the referenced supporting paths, including tools/, schemas/, configs/, prompts/, workflows/ and references/detection-strategy.md. They are external prerequisites, not bundled files:
Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.
> ⚠️ AUTHORIZED USE ONLY
> This skill is for educational purposes or authorized security assessments only.
> You must have explicit, written permission from the system owner before using this tool.
> Misuse of this tool is illegal and strictly prohibited.
> Mandatory confirmation gate
> Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:
> 1. Ask the user to state the exact target URL, IP, account, or resource.
> 2. Ask the user to confirm written authorization and the permitted scope.
> 3. Show the exact command(s) and explain their expected effect.
> 4. Wait for explicit confirmation in the current conversation.
>
> Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.
zeroize-audit — Claude Skill
When to Use
- Auditing cryptographic implementations (keys, seeds, nonces, secrets)
- Reviewing authentication systems (passwords, tokens, session data)
- Analyzing code that handles PII or sensitive credentials
- Verifying secure cleanup in security-critical codebases
- Investigating memory safety of sensitive data handling
When NOT to Use
- General code review without security focus
- Performance optimization (unless related to secure wiping)
- Refactoring tasks not related to sensitive data
- Code without identifiable secrets or sensitive values
---
Purpose
Detect missing zeroization of sensitive data in source code and identify zeroization that is removed or weakened by compiler optimizations (e.g., dead-store elimination), with mandatory LLVM IR/asm evidence. Capabilities include:
- Assembly-level analysis for register spills and stack retention
- Data-flow tracking for secret copies
- Heap allocator security warnings
- Semantic IR analysis for loop unrolling and SSA form
- Control-flow graph analysis for path coverage verification
- Runtime validation test generation
Scope
- Read-only against the target codebase (does not modify audited code; writes analysis artifacts to a temporary working directory).
- Produces a structured report (JSON).
- Requires valid build context (
compile_commands.json) and compilable translation units. - "Optimized away" findings only allowed with compiler evidence (IR/asm diff).
---
Inputs
See {baseDir}/schemas/input.json for the full schema. Key fields:
| Field | Required | Default | Description |
|---|---|---|---|
| path | yes | — | Repo root |
| compile_db | no | null | Path to compile_commands.json for C/C++ analysis. Required if cargo_manifest is not set. |
| cargo_manifest | no | null | Path to Cargo.toml for Rust crate analysis. Required if compile_db is not set. |
| config | no | — | YAML defining heuristics and approved wipes |
| opt_levels | no | ["O0","O1","O2"] | Optimization levels for IR comparison. O1 is the diagnostic level: if a wipe disappears at O1 it is simple DSE; O2 catches more aggressive eliminations. |
| languages | no | ["c","cpp","rust"] | Languages to analyze |
| max_tus | no | — | Limit on translation units processed from compile DB |
| mcp_mode | no | prefer | off, prefer, or require — controls Serena MCP usage |
| mcp_required_for_advanced | no | true | Downgrade SECRET_COPY, MISSING_ON_ERROR_PATH, and NOT_DOMINATING_EXITS to needs_review when MCP is unavailable |
| mcp_timeout_ms | no | — | Timeout budget for MCP semantic queries |
| poc_categories | no | all 11 exploitable | Finding categories for which to generate PoCs. C/C++ findings: all 11 categories supported. Rust findings: only MISSING_SOURCE_ZEROIZE, SECRET_COPY, and PARTIAL_WIPE are supported; other Rust categories are marked poc_supported=false. |
| poc_output_dir | no | generated_pocs/ | Output directory for generated PoCs |
| enable_asm | no | true | Enable assembly emission and analysis (Step 8); produces STACK_RETENTION, REGISTER_SPILL. Auto-disabled if emit_asm.sh is missing. |
| enable_semantic_ir | no | false | Enable semantic LLVM IR analysis (Step 9); produces LOOP_UNROLLED_INCOMPLETE |
| enable_cfg | no | false | Enable control-flow graph analysis (Step 10); produces MISSING_ON_ERROR_PATH, NOT_DOMINATING_EXITS |
| enable_runtime_tests | no | false | Enable runtime test harness generation (Step 11) |
---
Prerequisites
Before running, verify the following. Each has a defined failure mode.
C/C++ prerequisites:
| Prerequisite | Failure mode if missing |
|---|---|
| compile_commands.json at compile_db path | Fail fast — do not proceed |
| clang on PATH | Fail fast — IR/ASM analysis impossible |
| uvx on PATH (for Serena) | If mcp_mode=require: fail. If mcp_mode=prefer: continue without MCP; downgrade affected findings per Confidence Gating rules. |
| {baseDir}/tools/extract_compile_flags.py | Fail fast — cannot extract per-TU flags |
| {baseDir}/tools/emit_ir.sh | Fail fast — IR analysis impossible |
| {baseDir}/tools/emit_asm.sh | Warn and skip assembly findings (STACK_RETENTION, REGISTER_SPILL) |
| {baseDir}/tools/mcp/check_mcp.sh | Warn and treat as MCP unavailable |
| {baseDir}/tools/mcp/normalize_mcp_evidence.py | Warn and use raw MCP output |
Rust prerequisites:
| Prerequisite | Failure mode if missing |
|---|---|
| Cargo.toml at cargo_manifest path | Fail fast — do not proceed |
| cargo check passes | Fail fast — crate must be buildable |
| cargo +nightly on PATH | Fail fast — nightly required for MIR and LLVM IR emission |
| uv on PATH | Fail fast — required to run Python analysis scripts |
| {baseDir}/tools/validate_rust_toolchain.sh | Warn — run preflight manually. Checks all tools, scripts, nightly, and optionally cargo check. Use --json for machine-readable output, --manifest to also validate the crate builds. |
| {baseDir}/tools/emit_rust_mir.sh | Fail fast — MIR analysis impossible (--opt, --crate, --bin/--lib supported; --out can be file or directory) |
| {baseDir}/tools/emit_rust_ir.sh | Fail fast — LLVM IR analysis impossible (--opt required; --crate, --bin/--lib supported; --out must be .ll) |
| {baseDir}/tools/emit_rust_asm.sh | Warn and skip assembly findings (STACK_RETENTION, REGISTER_SPILL). Supports --opt, --crate, --bin/--lib, --target, --intel-syntax; --out can be .s file or directory. |
| {baseDir}/tools/diff_rust_mir.sh | Warn and skip MIR-level optimization comparison. Accepts 2+ MIR files, normalizes, diffs pairwise, and reports first opt level where zeroize/drop-glue patterns disappear. |
| {baseDir}/tools/scripts/semantic_audit.py | Warn and skip semantic source analysis |
| {baseDir}/tools/scripts/find_dangerous_apis.py | Warn and skip dangerous API scan |
| {baseDir}/tools/scripts/check_mir_patterns.py | Warn and skip MIR analysis |
| {baseDir}/tools/scripts/check_llvm_patterns.py | Warn and skip LLVM IR analysis |
| {baseDir}/tools/scripts/check_rust_asm.py | Warn and skip Rust assembly analysis (STACK_RETENTION, REGISTER_SPILL, drop-glue checks). Dispatches to check_rust_asm_x86.py (production) or check_rust_asm_aarch64.py (EXPERIMENTAL — AArch64 findings require manual verification). |
| {baseDir}/tools/scripts/check_rust_asm_x86.py | Required by check_rust_asm.py for x86-64 analysis; warn and skip if missing |
| {baseDir}/tools/scripts/check_rust_asm_aarch64.py | Required by check_rust_asm.py for AArch64 analysis (EXPERIMENTAL); warn and skip if missing |
Common prerequisite:
| Prerequisite | Failure mode if missing |
|---|---|
| {baseDir}/tools/generate_poc.py | Fail fast — PoC generation is mandatory |
---
Approved Wipe APIs
The following are recognized as valid zeroization. Configure additional entries in {baseDir}/configs/.
C/C++
explicit_bzeromemset_sSecureZeroMemoryOPENSSL_cleansesodium_memzero- Volatile wipe loops (pattern-based; see `volatile_wipe
… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- 1password – Thiết lập op CLI, đăng nhập, rồi đọc hoặc chèn secret.
- 007 – Kiểm toán bảo mật, tăng cường bảo vệ, mô hình hóa mối đe dọa (STRIDE/PASTA), Red/Blue…
- a11y-audit – Skill kiểm toán khả năng tiếp cận để quét, sửa và xác minh mức A và AA của WCAG 2.2 trên…
- 401-403-bypass-techniques – Dùng khi các route HTTP được bảo vệ trả về 401 hoặc 403.
- accessibility-compliance-accessibility-audit – Kiểm tra trang và hành trình người dùng theo phạm vi WCAG đã khai báo. Dùng khi xác định…
- accesslint-audit – Tìm và sửa các vấn đề truy cập WCAG 2.2. Hai chế độ — report (quét mã nguồn hoặc trang…
- accesslint-diff – So sánh các vi phạm truy cập của trang trực tiếp với một baseline — mặc định so sánh các…
- accesslint-scan – Kiểm tra trang trực tiếp về các vấn đề truy cập, xác định chính xác từng vi phạm WCAG…