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

c-review

Comprehensive C/C++ security code review, with coverage verified against a parse of the source

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

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

التنزيل

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

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

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

الملفات: 24 · الحجم: 911 ك.ب

نزّل ملف ZIP

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

التثبيت

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

التعليمات

c-review

C/C++ security code review. Bug-class knowledge based on the Trail of Bits Testing Handbook.

Invoke with /c-review:c-review. Artifacts land in $(pwd)/.c-review-results/<iso-timestamp>/.

uv must be on PATH — two phases run Python through it.

How it works

Most review tools split the work by bug type: one agent hunts buffer overflows, another hunts use-after-free, and so on. c-review splits it by place in the source instead.

A parser first cuts the codebase into units — one function, or a slice of a long function, capped at 150 lines. Every line of the tree lands in exactly one unit, and each unit belongs to exactly one agent. That is the coverage claim: not "the agents said they read it", but "a parser assigned it and we can check".

Then each agent works through its units by asking the same fixed set of ten questions of every one:

bounds at every write · integer width and signedness · allocation/free pairing · sizeof arithmetic · NUL termination · unchecked return values · what the unit assumes of its caller · banned APIs · macro contracts · initialisation

A question is only asked where the parser found something for it to be about — no writes in the function, no bounds question. And crucially, the parser counts the relevant spots (the twelve writes, the four malloc calls) and tells the agent the number but not the line numbers. The agent has to read the code to find them.

For each question the agent writes down what it found — the lines it examined and what was at them, whether or not it filed a bug. Those written answers are the coverage record (called the ledger in the code and artifacts). At the end, check_ledger.py re-derives the spots from the source and checks the agent's answers against them. An agent that skipped a function, or claimed "no bugs here" over twelve writes while naming none, fails that check and the run is reported as assembled but unverified.

Two things this buys, both of which a plain "review this code" prompt gives up:

  • A bug found does not end the question. A finding is a reason to look harder in that function, not to move on — the record still owes an account of the other eleven writes.
  • Coverage is a number you can check, reported as checks satisfied / checks required rather than "functions touched". A function can be touched by every agent while most of its questions go unanswered.

The bug-type catalogue — 56 classes in 18 groups — still exists, in two roles. Review agents get the class names so they can label what they find. Then a sweep phase takes the classes that got no finding anywhere — minus the ones the platform gate, the threat model or Detect's candidate-site check already removed — and sends one agent to look for them across the whole tree, which catches the scattered single-site slips a reader working through a region in order tends to walk past.

Pipeline

/c-review:c-review
└── SKILL.md                    collect parameters, resolve paths, one Workflow call
    └── workflows/c-review.js
        ├── 1. Detect               1 agent
        ├── 2. Review            4-14 agents
        ├── 3. Sweep              0-2 agents
        ├── 4. Dedup              0-1 agent
        └── 5. Assemble             1 agent
PhaseWhat it does
DetectRuns the parser to build the unit list. Also works out which platform the code targets (from real API usage, not from a single #include), which structs hold shared state, and which bug classes have any candidate site at all
ReviewThe main pass. One agent per contiguous slice of the unit list; each returns findings with severity, plus one coverage-record row per (unit × question)
SweepThe bug-type axis: one agent covering every class that got no finding anywhere and that Detect did not rule out. Plus the shared-state struct audit, only on request
DedupOnly the near-duplicate findings the assembler cannot merge by rule. Usually skipped
AssembleRuns the coverage check, merges duplicates, and writes every artifact

About 8-10 agents on a mid-size target. Everything that can be deterministic is code rather than an agent: the coverage check and the duplicate merges both live in the assembler, so no agent ever retypes another agent's findings.

There is no false-positive judge. Severity is assigned by the reviewer that found the bug and nothing rejects anything, so treat the output as unadjudicated — findings.json records severity_source: "reviewer" and run.judge_ran: false. Expect some findings to be wrong or out of scope.

Why the review agents have no shell

The coverage check only means something if the agent had to read the code to pass it. But the code that computes the answer — which lines each question is about — ships inside this plugin, and units.json sits in the run directory. One shell command over enumerate_units.py would reproduce the whole answer key without opening a single source file, and a review agent could then write a perfect coverage record having reviewed nothing. That is not hypothetical: it was demonstrated end to end, scoring 100% coverage with zero violations.

Hiding the file does not fix it, because the agent can read the plugin too. So the review, sweep and dedup agents are dispatched through agents/c-review-worker.md, whose tools: list is Read, Grep, Glob, Write — no shell, so the derivation cannot be run. That tool list is the control; a "please don't" in a prompt is not.

Two consequences worth knowing:

  • It is a hard dependency. If that file is missing or renamed, every producing agent fails to start and the run produces nothing.
  • The detect and assemble agents keep their shell, because their whole job is to run a command. They are trusted rather than controlled, which is why a green coverage check means "no gap this could see", not "nobody tampered with it". See AGENTS.md for the full threat model and its two known holes.

What each file does

FileRole
skills/c-review/SKILL.mdThe entry point. Collects the four parameters, resolves paths, makes one Workflow call, returns the report
workflows/c-review.jsThe orchestrator, shipping as /c-review:audit — workflows are namespaced by meta.name, not the filename. The bug-class catalogue, every agent prompt, the phase sequence, and the deterministic duplicate merges
agents/c-review-worker.mdThe tool scope for review, sweep and dedup agents — see above
scripts/enumerate_units.pyParses the tree and cuts it into units, deciding which questions each unit owes and counting the spots each question is about. Everything downstream is partitioned from this
scripts/check_ledger.pyThe coverage check: re-derives those spots from the source and diffs them against what the agents wrote down
scripts/assemble_findings.pyReads the per-agent part files, runs the coverage check, merges duplicates, and writes all four artifacts
scripts/findings_model.pyShared loader; decides which findings count as "reported", so the report and the SARIF cannot disagree
scripts/render_report.pyWrites REPORT.md
scripts/generate_sarif.pyWrites REPORT.sarif (SARIF 2.1.0)
tests/The suite, kept out of scripts/ so what ships and what only proves it works are separable — the tests are larger than the code they cover

Everything under scripts/ is plain Python with no agent in the loop, which is the point: merging, filtering and coverage-checking are deterministic, so they are code.

Parameters

ParameterValuesEffect
threat_modelREMOTE / LOCAL_UNPRIVILEGED / BOTHWhich bug classes are in scope, and the severity table the reviewer scores against
worker_modelhaiku / sonnet / opus / inheritModel for every agent in the workflow
severity_filterall / medium / highWhat reaches REPORT.md and REPORT.sarif
scope_subpathrepo-relative dir, optionalWhere findings may live, and the tree the unit list is built from. Reading for context defaults to the whole repo and is a separate knob (contextRoots)

Five workflow arguments are optional and rarely set by hand: maxUnitLines (150), reviewAgents (derived), linesPerAgent (1500), invariantAudit (off) and benchmarkMode (eval-only). See SKILL.md for what each does and the traps in linesPerAgent.

Output

.c-review-results/<stamp>/
├── REPORT.md         ← start here: severity-grouped, filtered, human-readable
├── REPORT.sarif      the same reported set as SARIF 2.1.0, for CI
├── findings.json     every finding, including ones merged as duplicates
├── ledger-gate.json  the coverage check: how many checks were required, how many were
│                     satisfied, which rows were missing, and every violation
├── units.json        the unit list, with per-question COUNTS — never the line numbers
├── detect.json       platform flags, entry points, shared-state structs
├── assignments/      one file per review agent: the units it owns
└── parts/            one file per agent: exactly what that agent produced

REPORT.md and REPORT.sarif share one definition of "reported", so the two cannot describe different sets. parts/, assignments/ and the four artifacts are cleared at the start of every run, so a run that fails partway cannot leave the previous run's files sitting in place looking current.

Not for

  • Kernel drivers or modules (Linux, Windows, macOS)
  • Managed languages (Java, C#, Python, Go, Rust)
  • Embedded or bare-metal code with no libc

Contributing

Design rationale, the coverage-record rules, the coverage check's threat model and its known limitations are in AGENTS.md. Read it before changing a prompt, a gate rule or how agents are dispatched — the rules there come from measured failures.

الملفات

  • مجلد.claude-plugin385 بايت
    • plugin.json385 بايت
  • مجلدagents1.9 ك.ب
    • c-review-worker.md1.9 ك.ب
  • مجلدscripts276 ك.بسكربت
    • assemble_findings.py93 ك.بسكربت
    • check_ledger.py43 ك.بسكربت
    • enumerate_units.py77 ك.بسكربت
    • findings_model.py20 ك.بسكربت
    • generate_sarif.py20 ك.بسكربت
    • pyproject.toml198 بايت
    • render_report.py22 ك.بسكربت
    • uv.lock220 بايت
  • مجلدskills12 ك.ب
    • مجلدc-review12 ك.ب
      • SKILL.md12 ك.ب
  • مجلدtests442 ك.بسكربت
    • conftest.py763 بايتسكربت
    • test_assemble_findings.py153 ك.بسكربت
    • test_check_ledger.py47 ك.بسكربت
    • test_enumerate_units.py88 ك.بسكربت
    • test_generate_sarif.py28 ك.بسكربت
    • test_render_report.py37 ك.بسكربت
    • test_workflow_args.py21 ك.بسكربت
    • test_workflow_assemble.py11 ك.بسكربت
    • test_workflow_run.py27 ك.بسكربت
    • test_workflow_sweep.py28 ك.بسكربت
  • مجلدworkflows128 ك.بسكربت
    • c-review.js128 ك.بسكربت
  • AGENTS.md20 ك.ب
  • LICENSE20 ك.ب
  • README.md10 ك.ب

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

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

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

    في الملف plugins/c-review/scripts/assemble_findings.py

  • يحتاج مراجعةتعمية أو تقييم ديناميكي للنص

    في الملف plugins/c-review/tests/test_workflow_args.py، السطر 71

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

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

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

أبلغ

عناصر مشابهة

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

    blockchain-web3

    Smart contract development with Solidity, DeFi protocol implementation, NFT platforms, and Web3 application architecture

    MITالملفات: 11

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

    building-secure-contracts

    Comprehensive smart contract security toolkit based on Trail of Bits' Building Secure Contracts framework. Includes vulnerability scanners for 6 blockchains and 5 development guideline assistants.

    CC-BY-SA-4.0الملفات: 58

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

    burpsuite-project-parser

    Search and extract data from Burp Suite project files (.burp) for security analysis

    CC-BY-SA-4.0الملفات: 8

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

    claude-md-management

    Tools to maintain and improve CLAUDE.md files - audit quality, capture session learnings, and keep project memory current.

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

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

    comprehensive-review

    Multi-perspective code analysis covering architecture, security, and best practices

    MITالملفات: 6

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

    constant-time-analysis

    Detect compiler-induced timing side-channels in cryptographic code

    CC-BY-SA-4.0الملفات: 51