post-patch-validation
Ce qu’il fait
Vérifie un correctif de sécurité avec des tests reproductibles sur le code d'origine et le code corrigé, en couvrant l'exploitation signalée, les variantes proches, les régressions et les nouveaux risques. Il s'adresse aux relecteurs et aux équipes qui décident si une correction peut être acceptée.
Quand l’utiliser
- ✓Quand un correctif de sécurité, un commit de remédiation ou une pull request est prêt pour la revue.
- ✓Quand un correctif généré par une IA doit être validé avant qu'une personne le relise ou le fusionne.
- ✓Quand un correctif peut corriger un chemin d'exploitation mais manquer d'autres variantes de la même cause.
Lien du skill
https://github.com/trailofbits/skills/blob/main/plugins/post-patch-validation/skills/post-patch-validation/SKILL.mdCopiez-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
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Valide ce correctif de sécurité face à l'exploitation d'origine et vérifie s'il laisse passer des variantes.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
Le skill fixe la base vulnérable et la version corrigée, exécute la preuve d'origine et les variantes proches, et vérifie que le comportement à conserver fonctionne toujours. Il indique ce qui échoue et ce qui n'a pas été testé.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
Post-Patch Validation
Validate a security patch against the reported bug and the surrounding code it affects. Give the patch author reproducible failures to fix and identify what still needs testing. Apply the same checks to human and agent patches. The diff, author, upstream implementation, and original proof of concept alone cannot establish correctness.
When to Use
- A security fix, remediation commit, patch file, or pull request already exists.
- An AI-generated patch needs validation before human review or merge.
- A fix may cover one exploit path while missing variants of the same root cause.
- A security fix may alter legitimate behavior or introduce a new vulnerability.
- A patch author needs concrete failures and coverage gaps before another revision.
When NOT to Use
- No patch exists yet; use vulnerability discovery or fix implementation first.
- The task is to review an audit finding against a report without executing patch evidence.
- The task is only to convert a finding into a permanent project test.
- The target is remote or production. This skill executes local code and tests only.
- The user has not authorized execution of the repository's code or test suite.
Quick Start
Pin the vulnerable base and patched input. Prefer immutable commits. For uncommitted work, create a binary patch file first; do not validate in the user's working tree.
Scaffold a pinned plan:
uv run {baseDir}/scripts/post_patch_validation.py scaffold \ --repo . \ --base-ref <vulnerable-ref> \ --patched-ref <patched-ref> \ --finding-id <stable-id> \ --finding-summary "<root cause and impact>" \ --evidence-level runtime \ --output post-patch-validation/plan.jsonUse
--patch-file <path>instead of--patched-reffor a patch artifact. Choose the highest honest evidence level:sourcefor source/patch invariants only,buildwhen target code is compiled or analyzed but the reported behavior is not executed, orruntimewhen the checks execute the reported behavior and its safety assertions.Inspect the finding, diff, callers, sibling paths, cleanup/error paths, and existing tests. Populate
checksin the generated plan. Runprint-schemafor the structural schema:uv run {baseDir}/scripts/post_patch_validation.py print-schemaRun
validate-planfor the complete validation, including coverage, command restrictions, and pinned inputs, before executing code:uv run {baseDir}/scripts/post_patch_validation.py validate-plan \ --plan post-patch-validation/plan.jsonExecute the evidence plan:
uv run {baseDir}/scripts/post_patch_validation.py run \ --plan post-patch-validation/plan.json \ --output post-patch-validation/resultsReport
result.json,report.md, the evidence level, and the completeassessment. Return each finding to the patch author with its check ID, assertion, and saved logs. Identify each validation gap separately, including gaps that coexist with supported findings. After the author revises the patch, pin the new inputs and save a fresh validation run. Preserve the prior evidence. Passing supplied checks still requires human review before acceptance.
Evidence Contract
The runner rejects incomplete plans. Supply at least one check of every kind:
| Kind | Required observation |
|---|---|
control |
Benign harness succeeds on both base and patch |
exploit |
Original safety assertion fails on base and succeeds on patch |
variant |
A distinct root-cause variant fails on base and succeeds on patch |
behavior |
Unaffected behavior succeeds with byte-identical selected output |
regression |
Targeted non-security regression check succeeds on both revisions |
security |
Adjacent/new-vulnerability check succeeds on base and patch |
suite |
Existing project suite, sanitizer, or deterministic fuzz campaign succeeds on patch |
Commands are argv arrays, never shell strings. Put complex setup in a checked-in or plan artifact
script and invoke it with {plan_dir}. The runner fixes locale/timezone/hash-seed inputs, executes
checks in lexical ID order, records raw stdout/stderr, and never edits the original worktree.
Each check's timeout_seconds defaults to 300 and accepts integers from 1 through 3600.
Exceeding the timeout leaves a validation gap. A timeout alone does not establish a regres
Questions fréquentes
Fonctionne-t-il sur des systèmes distants ou de production ?
Non. Il n'exécute que du code et des tests locaux, et seulement si vous l'autorisez.
Un diff propre suffit-il pour faire confiance à un correctif ?
Non. Le skill indique qu'un diff, son auteur ou la preuve d'origine ne suffisent pas à établir la justesse.
Aide-t-il l'auteur du correctif ?
Oui. Il fournit des échecs concrets et les lacunes de couverture pour une nouvelle révision.
Détails
Description originale de l’auteur
Validates security patches with reproducible baseline-versus-patched evidence, including original exploits, root-cause variants, behavior preservation, regressions, and newly introduced security failures. Use after a patch exists and before accepting, merging, or reporting it as fixed; also use when an AI-generated patch, remediation commit, pull request, or proposed upstream fix needs adversarial post-patch validation across any language.
repo: trailofbits/skills
Popularité
- Étoiles GitHub
- 8.0k
- Position au classement
- #12693
- Licence
- CC-BY-SA-4.0
- Mis à jour
- 02/11/2026
Commentaires
- …
Autres skills de ce dépôt
audit-context-building
8.0kAide votre agent à comprendre un code inconnu avant une revue de sécurité, en cartographiant ce que chaque fonction suppose, garantit et utilise.
algorand-vulnerability-scanner
8.0kAide votre agent à scanner des contrats Algorand (TEAL, PyTeal) pour 11 failles courantes, comme la réaffectation de clé ou les frais non contrôlés.
audit-prep-assistant
8.0kAide votre agent à préparer votre code pour une revue de sécurité externe, avec analyse statique, couverture de tests, nettoyage du code mort et documentation claire.
cairo-vulnerability-scanner
8.0kAide votre agent à scanner les contrats Cairo sur StarkNet pour 6 problèmes graves, comme les dépassements arithmétiques et le rejeu de signature.
Skills similaires
reverse-engineer-anything
422kAide votre agent à analyser les applications et paquets livrés, pour expliquer leurs fonctions, comparer des versions ou guider une reconstruction, avec REA.
1password
394kAide votre agent à configurer l'interface en ligne de commande de 1Password, à se connecter, et à lire ou injecter des secrets sans afficher leurs valeurs dans le chat.
healthcheck
394kAide votre agent à auditer l'ordinateur ou le serveur qui fait tourner OpenClaw pour détecter des risques de sécurité, comme SSH, le pare-feu, les mises à jour et les sauvegardes, puis à proposer des corrections sûres.