c-review
Skill này làm gì
Chạy review bảo mật cho chương trình C và C++ gốc, tìm hỏng bộ nhớ, tràn số nguyên, race condition và các lỗi tương tự. Dành cho lập trình viên và kiểm toán viên làm việc với daemon, dịch vụ và phần mềm máy tính để bàn.
Khi nào nên dùng
- ✓Khi kiểm toán viên review một ứng dụng C hoặc C++ gốc để tìm vấn đề an toàn bộ nhớ.
- ✓Khi lập trình viên kiểm tra một daemon hoặc dịch vụ Windows về tràn số nguyên hoặc race condition.
- ✓Khi nhóm cần review bảo mật cho code C hoặc C++ chạy ở user space.
Liên kết skill
https://github.com/trailofbits/skills/blob/main/plugins/c-review/skills/c-review/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Review dịch vụ mạng C++ của tôi tìm lỗi bộ nhớ và tràn số nguyên mà kẻ tấn công từ xa có thể lợi dụng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill hỏi về mô hình mối đe dọa, như kẻ tấn công từ xa hay cục bộ, cùng phạm vi và mức nghiêm trọng cần báo cáo. Sau đó nó review code bằng các worker riêng và trả về một báo cáo duy nhất.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
C/C++ Security Review
Resolve four parameters, make one Workflow call, return the report. The workflow owns
concurrency, retries and result collection.
Use for: native C/C++ userspace — memory safety, integer overflow, races, type confusion, Linux/macOS daemons, Windows services.
Not for: kernel drivers or modules; managed languages (Java, C#, Python, Go, Rust); embedded or bare-metal code with no libc.
Phase 0 — Parameters
Parse any free text on the invocation line (flamenco only, high severity only, use haiku) and pre-fill what it implies. Then make one AskUserQuestion call for
whatever is still unresolved. Never silently default a required parameter.
| Parameter | Values | Inferring it from the invocation |
|---|---|---|
threat_model |
REMOTE / LOCAL_UNPRIVILEGED / BOTH |
"remote", "network", "attacker" → REMOTE; "local", "unprivileged" → LOCAL_UNPRIVILEGED; otherwise ask |
worker_model |
haiku / sonnet / opus / inherit |
An explicit model name. Otherwise ask. inherit uses the session model |
severity_filter |
all / medium / high |
"all", "every", "noisy" → all; "medium and above" → medium; "high only" → high; otherwise ask |
scope_subpath |
repo-relative directory, optional | "X only", "just audit X/" → the matching subdirectory, fuzzy-matched against top-level dirs. Absent → .. Ambiguous → ask |
Two scopes stay separate for the whole run:
finding_scope_root=scope_subpath(default.) — a finding must live inside it, and it is the tree the unit list is generated from.context_roots=.— read freely to establish callers, build flags and reachability. Narrow it tofinding_scope_rootonly if the user explicitly forbids wider reading, and say that reachability confidence drops when you do.
Phase 1 — Resolve paths
Resolve this plugin's directory from this SKILL.md's installed location to an absolute
plugin_root: it holds workflows/c-review.js,
agents/c-review-worker.md, and
scripts/assemble_findings.py. Print that path; stop if
any is missing. Do not search caches or the audited repository for another plugin copy.
# The workflow cannot call Date.now(), so the timestamp is made here.
output_dir="$(pwd)/.c-review-results/$(date -u +%Y%m%dT%H%M%SZ)"
mkdir -p "$output_dir"; echo "$output_dir"
# A Workflow script has no filesystem APIs, and `assemble_findings.py` resolves `--scope`
# against ITS OWN cwd. Resolve it once here and pass BOTH spellings, or the workflow strips
# `src/` from a finding's path while the assembler strips `/repo/src/`, and the two disagree
# about which findings are duplicates of each other.
scope_abs="$(cd "${scope_subpath:-.}" && pwd)" || echo "scope_subpath does not exist"
echo "$scope_abs"
uv must be on PATH: Detect runs the unit enumerator and Assemble runs
assemble_findings.py. If uv is missing, say so and stop — the whole review is
partitioned from that unit list.
Phase 2 — Run the workflow
Invoking this skill is the opt-in to multi-agent orchestration — call Workflow
without asking again. A review of a real codebase also runs past any default workflow
size guideline; that guideline is advisory and this is the case it exempts. Do not
shrink the fan-out to fit it, and do not substitute hand-spawned Agent calls.
One Workflow call. scriptPath takes the absolute path resolved in Phase 1; args
must be a real JSON object, not a JSON-encoded string.
Workflow({
scriptPath: "<plugin_root>/workflows/c-review.js",
args: {
outputDir: "<output_dir>",
pluginRoot: "<plugin_root>",
threatModel: "REMOTE",
severityFilter: "all",
findingScopeRoot: "expat/lib",
findingScopeRootAbs: "/abs/path/to/repo/expat/lib",
contextRoots: ".",
workerModel: "sonnet"
}
})
findingScopeRootAbs is the scope_abs from Phase 1 and is not optional in practice:
omitted, the workflow tells the assembler no absolute root is known and a finding filed as
/repo/expat/lib/xmlparse.c stops merging with the same bug filed as xmlparse.c.
Six further arguments are optional. Omitted, each takes its default; passed with the wrong TYPE, the workflow throws with the field name rather than defaulting. Pass them only when the user asks or when running an evaluation:
| Argument | Default | What i
Câu hỏi thường gặp
Những gì không được bao phủ?
Driver nhân hệ điều hành, các ngôn ngữ được quản lý như Java, Python, Go và Rust, và code bare-metal không có thư viện C đều nằm ngoài phạm vi.
Nó có hỏi trước khi chạy không?
Có. Nó hỏi về mọi thiết lập không thể suy ra, như mô hình mối đe dọa hoặc bộ lọc mức nghiêm trọng, thay vì đoán.
Nó có chỉ kiểm tra một thư mục được không?
Có. Bạn có thể giới hạn review trong một thư mục con của dự án.
Chi tiết
Mô tả gốc của tác giả
Performs comprehensive C/C++ security review for memory corruption, integer overflows, race conditions, and platform-specific vulnerabilities. Use when auditing native C/C++ applications, reviewing daemons or services for memory safety, or hunting integer overflow / use-after-free / race conditions in userspace code.
repo: trailofbits/skills
Độ phổ biến
- Sao GitHub
- 8.0k
- Vị trí xếp hạng
- #12667
- Giấy phép
- CC-BY-SA-4.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
audit-context-building
8.0kGiúp agent tìm hiểu một codebase lạ trước khi review bảo mật, lập bản đồ những gì mỗi hàm giả định, đảm bảo và phụ thuộc vào.
algorand-vulnerability-scanner
8.0kGiúp agent quét smart contract Algorand viết bằng TEAL hoặc PyTeal để tìm 11 vấn đề bảo mật phổ biến, như tấn công rekey và phí không được kiểm tra.
audit-prep-assistant
8.0kGiúp agent chuẩn bị codebase cho một đợt review bảo mật bên ngoài, với phân tích tĩnh, độ phủ test, dọn mã chết và tài liệu rõ ràng.
cairo-vulnerability-scanner
8.0kGiúp agent quét smart contract Cairo trên StarkNet để tìm 6 vấn đề nghiêm trọng, gồm tràn số học, thông điệp xuyên lớp rủi ro và replay chữ ký.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.