Zum Inhalt springen
Skillpedia
Sicherheit8.0k · #12693

post-patch-validation

Was er macht

Prüft einen Sicherheits-Patch mit wiederholbaren Tests auf dem ursprünglichen und dem gepatchten Code. Dabei werden der gemeldete Exploit, ähnliche Varianten, Regressionen und neue Risiken abgedeckt. Er richtet sich an Reviewer und Teams, die entscheiden, ob eine Korrektur sicher übernommen werden kann.

Wann du ihn nutzt

  • ✓Wenn ein Sicherheits-Patch, ein Korrektur-Commit oder ein Pull Request reif für das Review ist.
  • ✓Wenn ein KI-erzeugter Patch vor der Prüfung oder dem Merge durch einen Menschen validiert werden muss.
  • ✓Wenn ein Patch einen Exploit-Pfad schließt, andere Varianten derselben Ursache aber übersehen könnte.

Link zum Skill

https://github.com/trailofbits/skills/blob/main/plugins/post-patch-validation/skills/post-patch-validation/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/trailofbits/skills/blob/main/plugins/post-patch-validation/skills/post-patch-validation/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Prüfe diesen Sicherheits-Patch gegen den ursprünglichen Exploit und schau nach Varianten, die er vielleicht übersieht.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Skill legt die verwundbare Basis und die gepatchte Version fest, führt den ursprünglichen Nachweis und verwandte Varianten aus und prüft, ob das zu erhaltende Verhalten noch funktioniert. Er meldet, was fehlschlägt und was nicht getestet wurde.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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

  1. 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.

  2. 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.json
    

    Use --patch-file <path> instead of --patched-ref for a patch artifact. Choose the highest honest evidence level: source for source/patch invariants only, build when target code is compiled or analyzed but the reported behavior is not executed, or runtime when the checks execute the reported behavior and its safety assertions.

  3. Inspect the finding, diff, callers, sibling paths, cleanup/error paths, and existing tests. Populate checks in the generated plan. Run print-schema for the structural schema:

    uv run {baseDir}/scripts/post_patch_validation.py print-schema
    
  4. Run validate-plan for 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.json
    
  5. Execute the evidence plan:

    uv run {baseDir}/scripts/post_patch_validation.py run \
      --plan post-patch-validation/plan.json \
      --output post-patch-validation/results
    
  6. Report result.json, report.md, the evidence level, and the complete assessment. 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

Häufige Fragen

Funktioniert er auf entfernten oder produktiven Systemen?

Nein. Er führt nur lokalen Code und lokale Tests aus, und nur, wenn du das freigibst.

Reicht ein sauberer Diff, um einem Patch zu vertrauen?

Nein. Der Skill sagt, dass ein Diff, sein Autor oder der ursprüngliche Nachweis allein die Korrektheit nicht belegen können.

Hilft er dem Patch-Autor?

Ja. Er liefert konkrete Fehler und Lücken in der Abdeckung für eine neue Überarbeitung.

Details

Originalbeschreibung des Autors

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

Beliebtheit

GitHub-Sterne
8.0k
Platz im Ranking
#12693
Lizenz
CC-BY-SA-4.0
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills