Aller au contenu
Skillpedia
Sécurité8.0k · #12667

c-review

Ce qu’il fait

Lance une revue de sécurité de programmes natifs C et C++, à la recherche de corruptions mémoire, de dépassements d'entiers, de conditions de course et de failles similaires. Il s'adresse aux développeurs et auditeurs qui travaillent sur des démons, des services et des logiciels de bureau.

Quand l’utiliser

  • ✓Quand un auditeur examine une application native C ou C++ pour des problèmes de sécurité mémoire.
  • ✓Quand un développeur vérifie un démon ou un service Windows pour les dépassements d'entiers ou les conditions de course.
  • ✓Quand une équipe a besoin d'une revue de sécurité d'un code C ou C++ qui s'exécute en espace utilisateur.

Lien du skill

https://github.com/trailofbits/skills/blob/main/plugins/c-review/skills/c-review/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/trailofbits/skills/blob/main/plugins/c-review/skills/c-review/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Relis mon service réseau en C++ pour repérer les bugs mémoire et les dépassements d'entiers qu'un attaquant distant pourrait exploiter.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Le skill demande le modèle de menace, par exemple un attaquant distant ou local, ainsi que le périmètre et la gravité à signaler. Il relit ensuite le code avec des travailleurs séparés et renvoie un seul rapport.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

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 to finding_scope_root only 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

Questions fréquentes

Qu'est-ce qui n'est pas couvert ?

Les pilotes noyau, les langages gérés comme Java, Python, Go et Rust, et le code bare-metal sans bibliothèque C sont hors champ.

Pose-t-il des questions avant de lancer ?

Oui. Il demande les réglages qu'il ne peut pas déduire, comme le modèle de menace ou le filtre de gravité, au lieu de deviner.

Peut-il analyser un seul dossier ?

Oui. Vous pouvez limiter la revue à un sous-dossier du projet.

Détails

Description originale de l’auteur

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

Popularité

Étoiles GitHub
8.0k
Position au classement
#12667
Licence
CC-BY-SA-4.0
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires