post-patch-validation skill
✓ 공식scripts재현 가능한 익스플로잇, 근본 원인 변형(root-cause variants), 회귀 테스트를 사용하여 베이스라인 코드와 패치된 코드를 비교함으로써 보안 패치를 검증합니다.
- GitHub 스타
- 8,136
- 파일
- 5
- 마지막 커밋
- 2026년 11월 11일
- 라이선스
- CC-BY-SA-4.0
- 허용된 도구
- 7
post-patch-validation skill은 무엇을 하나요?
post-patch-validation은(는) agent skill입니다. 재현 가능한 익스플로잇, 근본 원인 변형(root-cause variants), 회귀 테스트를 사용하여 베이스라인 코드와 패치된 코드를 비교함으로써 보안 패치를 검증합니다.
skill의 SKILL.md에서 생성된 요약입니다.
post-patch-validation skill 정보
보안 엔지니어와 개발자는 보안 패치가 새로운 버그를 유발하거나 기존 기능을 망가뜨리지 않고 실제로 취약점을 해결하는지 확인하기 위해 이 SKILL을 사용합니다. 이 도구는 구조화된 검증 계획을 사용하여 취약한 베이스라인과 패치된 버전의 코드를 비교하는 방식으로 작동합니다. 프로세스에는 원래의 익스플로잇 실행, 근본 원인 변형 테스트, 회귀 체크, 그리고 정상적인 애플리케이션 동작이 변경되지 않았는지 확인하는 과정이 포함됩니다.
에이전트는 패치나 Remediation commit이 존재하지만 아직 머지되거나 수정 완료로 보고되기 전에 이 SKILL을 로드해야 합니다. 이 도구는 증거 계획을 구성, 검증 및 실행하기 위해 Python 기반 오케스트레이션 스크립트에 의존합니다. 도구는 JSON 요약, markdown 보고서, 모든 체크에 대한 아카이브된 scratch 디렉토리를 포함한 상세한 결과를 생성합니다. 로컬 저장소에서 실행하도록 설계되었으며, 코드나 테스트 스위트를 실행하려면 명시적인 권한이 필요합니다. 단순한 diff 리뷰와 달리, 이 SKILL은 오탐을 방지하기 위해 런타임 어설션과 side-blind 실행을 통해 구체적인 증거를 제공합니다.
agent가 수행할 수 있는 작업
- 1AI 생성 보안 패치 검증AI 에이전트가 생성한 패치가 사람이 코드를 검토하기 전에 취약점을 올바르게 해결하는지 확인합니다.
- 2근본 원인 변형 탐지수정 사항이 단일 익스플로잇 경로뿐만 아니라 특정 취약점이 트리거될 수 있는 모든 가능한 경로를 커버하는지 확인합니다.
- 3보안 회귀 방지보안 수정이 인접한 코드 경로에 의도치 않게 새로운 취약점을 도입하는지 확인합니다.
- 4동작 보존 확인보안 수정이 영향을 받지 않는 애플리케이션 기능의 예상 출력값을 변경하지 않는지 확인합니다.
skill의 SKILL.md를 기반으로 작성되었습니다. 모든 사용 사례는 해당 문서의 인용구와 대조 확인되었습니다.
post-patch-validation skill 설치 방법
각 명령은 skill 폴더를 클라이언트의 skills 디렉터리에 복사합니다. 클라이언트를 재시작하거나 새 세션을 시작하여 로드하세요.플러그인에 post-patch-validation skill 설치
/plugin marketplace add trailofbits/skills /plugin install post-patch-validation@trailofbits
Claude Code에 post-patch-validation skill 설치
~/.claude/skills/post-patch-validation/SKILL.md
$ npx degit trailofbits/skills/plugins/post-patch-validation/skills/post-patch-validation ~/.claude/skills/post-patch-validationClaude Code (project)에 post-patch-validation skill 설치
.claude/skills/post-patch-validation/SKILL.md
$ npx degit trailofbits/skills/plugins/post-patch-validation/skills/post-patch-validation .claude/skills/post-patch-validationCodex에 post-patch-validation skill 설치
~/.agents/skills/post-patch-validation/SKILL.md
$ npx degit trailofbits/skills/plugins/post-patch-validation/skills/post-patch-validation ~/.agents/skills/post-patch-validationGemini CLI에 post-patch-validation skill 설치
~/.gemini/skills/post-patch-validation/SKILL.md
$ npx degit trailofbits/skills/plugins/post-patch-validation/skills/post-patch-validation ~/.gemini/skills/post-patch-validationClaude.ai에 post-patch-validation skill 설치
npx degit trailofbits/skills/plugins/post-patch-validation/skills/post-patch-validation post-patch-validation && zip -r post-patch-validation.zip post-patch-validation # claude.ai → Customize → Skills → + → Create skill → Upload a skill → post-patch-validation.zip
자동 검사
2026년 11월 15일에 실행됨전체 보고서 →아직 검증되지 않았습니다. 스킬은 점수 80, 심각한 발견 없음, 검사에 충분한 데이터가 필요합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능trailofbits/skills/plugins/post-patch-validation/skills/post-patch-validation is public and reachablegithub.com/trailofbits/skills/tree/HEAD/plugins/post-patch-v ↗통과
- 오픈 소스 라이선스 (OSI)CC-BY-SA-4.0 is not OSI-approvedspdx.org/licenses/CC-BY-SA-4.0.html ↗결함 발견
- 최근 1년 내 커밋 또는 릴리스Last commit 2026-11-11github.com/trailofbits/skills/commits ↗통과
- 스크립트에 다운로드 후 실행이나 자격 증명 탈취가 없음1 script read; no download-and-run, remote eval, base64 execution or credential upload통과
- SKILL.md에 숨겨진 지침 없음No override phrases, safeguard switches, credential requests or hidden charactersgithub.com/trailofbits/skills/blob/HEAD/plugins/post-patch-v ↗통과
- 사전 허용 도구가 제한됨Bash lets the agent run any shell command without askinggithub.com/trailofbits/skills/blob/HEAD/plugins/post-patch-v ↗결함 발견
- SKILL.md가 Agent Skills 형식을 따름Valid name and description; says when to use it; 262 linesgithub.com/trailofbits/skills/blob/HEAD/plugins/post-patch-v ↗통과
SKILL.md
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-schema -
Run
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.json -
Execute the evidence plan:
uv run {baseDir}/scripts/post_patch_validation.py run \ --plan post-patch-validation/plan.json \ --output post-patch-validation/results -
Report
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 regression.
Every plan also contains a sorted submodules array ([] when none). Scaffolding infers affected
Gitlinks from the changed-file inventory. The runner initializes those pinned commits from the
source repository's existing Git module objects, never from .gitmodules network URLs; initialize
or fetch them in the source repository before validation.
Exploit and variant checks must prove they ran
A nonzero exit does not mean the vulnerability reproduced. An import error, a failed build, a
missing dependency, and a failed safety assertion all exit nonzero and are indistinguishable to the
runner. Every exploit and variant check must print and flush PPV_REACHED immediately
before it evaluates its assertion, on both revisions:
"argv": ["python3", "-c", "import app; value = app.render('<'); print('PPV_REACHED', flush=True); assert value == '<'"]
The token is also in the environment as PPV_REACHED_MARKER. It must land on stdout, as a line
of its own. Stderr is not scanned, because a Python SyntaxError traceback echoes the offending
source and would otherwise satisfy the check for a harness that executed nothing. A run without it
leaves a marker_missing gap. Independent findings from other checks remain in the result.
Flush explicitly: a harness whose payload segfaults or calls _exit loses buffered output and forfeits its own evidence.
These checks also run side-blind. {side} is not expanded for them, PPV_SIDE is absent from
their environment, the checkout directory is randomly named, and the plan validator rejects any
exploit or variant check whose argv or env mentions either. An assertion that can see which
revision it is on can assert on that instead of on the code, which is the cheapest possible way
to fake a reproduction followed by a fix.
Environment
Checks run under a fixed minimal environment: PATH, HOME, and a handful of temp/user keys,
plus LANG/LC_ALL=C, TZ=UTC, PYTHONHASHSEED=0, NO_COLOR, TERM=dumb. Everything else in
the caller's environment is dropped. Toolchains that need more get it explicitly:
uv run {baseDir}/scripts/post_patch_validation.py run \
--plan post-patch-validation/plan.json \
--output post-patch-validation/results \
--allow-env JAVA_HOME --allow-env CARGO_HOME
Forwarded names and values are recorded in result.json. A requested variable that is unset is an
error, not an empty string. Two classes are refused outright: names that read as credentials
(*SECRET*, *TOKEN*, *API_KEY*, …), because the value would be written into the result; and
names that change what executes (LD_PRELOAD, BASH_ENV, NODE_OPTIONS, GIT_SSH_COMMAND, …),
because those variables can change which code executes.
The runner's fixed variables and every PPV_* name are also reserved and cannot be forwarded.
Placeholders expanded in argv and per-check env values: {checkout} (the revision under test),
{plan_dir} (an isolated copy of the plan artifacts for that one invocation), {scratch} (a
fresh opaque directory for that one check invocation), and
{side} (base or patched, and not available to exploit/variant checks). The same values
arrive as PPV_CHECKOUT, PPV_PLAN_DIR, PPV_SCRATCH, PPV_SIDE, and PPV_CASE_ID. Write only
under {scratch}; the evidence directory path is not passed to checks. Base and patched invocations
do not share runner-managed scratch, plan, or worktree roots. After each invocation exits, its
scratch tree is archived under the deterministic results/scratch/<check-id-and-side> path, its
private plan copy is discarded, and every readable argv element that resolves to a file is hashed
in argv_files. Files inside the isolated plan or checkout roots are additionally retained under
results/helpers/<sha256> up to 16 MiB; the record explains why any other file was not archived.
Use a dedicated directory for plan.json: its sibling files and directories are copied into each
invocation's {plan_dir}. Keep helper code under that directory's checks/ directory or checked
into the target repository so its bytes are reviewable. The machine plan containing commit pins,
the current output directory, and detected prior result trees are excluded; symlinks are rejected.
The clean snapshot remains only in runner memory, and
exploit/variant sides execute in random order while evidence filenames remain deterministic.
Stdout/stderr use anonymous or randomly named capture descriptors and are copied to the named
evidence files only after the child exits, so fd inspection cannot disclose the side label.
This isolation is not a host sandbox: checks run with the caller's privileges and a malicious helper could use arbitrary external state or deliberately infer the revision from source or Git metadata. Inspect the content-addressed helper artifacts, and use an OS/container sandbox when the check code itself is untrusted.
Active validation worktrees are Git-locked with random owner tokens backed by kernel file locks, so
another concurrent validator cannot prune them and PID reuse cannot impersonate an owner. If the
runner is forcibly killed, the next run unlocks stale validator-owned registrations. For manual
recovery, inspect git worktree list, then use git worktree unlock <path> and
git worktree remove --force <path> (or git worktree prune after the path is gone).
Read evidence-model.md when designing coverage, selecting variants, or interpreting findings and validation gaps. Do not read it for routine CLI execution.
Coverage Rules
- Derive variants from the root cause, not cosmetic mutations of the original payload.
- Enumerate sibling call sites, alternate callbacks/outputs, error paths, teardown, ownership, serialization, and boundary values touched by the fix.
- Make each exploit or variant test assert the safe behavior. It must fail on the vulnerable base; a test that passes on both revisions proves nothing about remediation. Read the base-side stderr and confirm the failure is the assertion you wrote, not a harness that never got there.
- Keep exploit and variant assertions limited to the security invariant. Test liveness, exact
error types/messages, timing, and compatibility separately as
behaviororregressionchecks; otherwise an unrelated contract change can masquerade as proof that the vulnerability remains. - Keep the
controlharness benign and make it exercise the changed component. It establishes that the harness works on both revisions. Failed controls leave gaps and prevent attributing other failures to the patch. The raw observations remain available for review. - Use
behavioronly for behavior that should remain unchanged. Exact output comparison is deliberate; move unstable values behind a deterministic test harness instead of normalizing them away in prose. - Make
securitychecks pass on the vulnerable base before treating a patched failure as newly introduced. A failed baseline leaves attribution unresolved. - Do not edit the patch during validation. Return failures to the patch author and start a new, freshly pinned run.
Reading the result
result.json schema 2.0 contains an assessment with status, findings, gaps, and
human_review_required. Status is complete when all required checks produced usable evidence,
even if some checks found failures. Status is incomplete when any gap remains. Findings name the
check ID, check kind, and failed expectation. Gaps name the check ID and missing evidence, with a
null check ID for run-level problems such as cleanup failures.
Suite checks run on the patched revision first. A completed failure triggers the same check on baseline. If baseline passes, report the failure after the patch. If both fail, preserve both logs and report that attribution is unresolved. Do not assume matching exit codes mean the same failure.
The runner exits 0 for complete checks with no findings, 1 for complete checks with findings, 10 for incomplete validation, and 64 for invalid inputs. Read the artifact even after exit 10: it can contain supported findings alongside gaps. Source or build evidence cannot establish runtime behavior. State the evidence level alongside any passing result.
Claude Dynamic Workflow
Claude Code exposes the bundled workflow as /post-patch-validation:validate-patch.
To pass structured inputs through the Workflow tool, use the name without a leading slash:
Workflow({
name: 'post-patch-validation:validate-patch',
args: {
finding: '<finding text or local path>',
baseRef: '<vulnerable-ref>',
patchRef: '<patched-ref>',
workdir: 'post-patch-validation',
},
})
Use patchFile instead of patchRef when appropriate. The workflow uses fixed coverage
lenses to propose checks and a fixed executor to run this skill. Agents may author test
artifacts. The Python runner records findings and gaps, and reviewers report coverage or evidence
concerns separately. NEEDS_REPAIR returns supported failures even when other checks left gaps.
BLOCKED means evidence is incomplete without a supported failure. Passing checks advance to
READY_FOR_HUMAN_REVIEW only after both evidence reviews approve, otherwise REVIEW_REQUIRED.
The workflow cannot ask questions after launch, so pass every input up front.
Rationalizations to Reject
| Rationalization | Required response |
|---|---|
| "The original PoC no longer works" | Test at least one independent root-cause variant |
| "The exploit failed on base, so it reproduced" | Confirm the marker and that the failure is the assertion, not a broken harness |
| "The full suite passes" | Prove baseline reproduction and targeted behavior explicitly |
| "This matches the upstream/canonical patch" | Treat provenance as context, not evidence |
| "The diff is tiny" | Exercise callers, failure paths, and teardown affected by the change |
| "All supplied checks passed" | Preserve artifacts and require human review |
| "A flaky rerun passed" | Keep the first pinned result; fix nondeterminism before retrying |
| "There is no obvious variant" | Inspect sibling sites and boundaries; otherwise report the missing coverage |
이 스킬의 파일
5post-patch-validation skill 질문
Claude Code에 post-patch-validation skill을 어떻게 설치하나요?
npx degit trailofbits/skills/plugins/post-patch-validation/skills/post-patch-validation ~/.claude/skills/post-patch-validation를 실행합니다. Claude Code는 ~/.claude/skills(모든 프로젝트) 또는 .claude/skills(한 프로젝트)에서 skills를 로드하며, 설명이 작업과 일치할 때 skill을 사용합니다.
post-patch-validation skill을 사용할 수 있는 클라이언트는 무엇인가요?
Agent Skills 형식을 읽는 모든 클라이언트(Claude Code, Codex, Gemini CLI, claude.ai(ZIP으로 업로드))가 사용할 수 있습니다. skill 내 스크립트는 클라이언트가 코드 실행을 허용하는 경우에만 실행됩니다.
post-patch-validation SKILL은 언제 사용해야 하나요?
보안 수정 사항, Remediation commit 또는 AI가 생성한 패치가 존재하며, 이를 원래의 버그, 잠재적 변형 또는 새로운 회귀 문제와 비교하여 검증해야 할 때 사용합니다.
사용 가능한 증거 수준(evidence levels)에는 어떤 것들이 있나요?
이 SKILL은 세 가지 수준을 지원합니다. 불변량(invariants)을 위한 'source', 실행 없이 컴파일/분석된 코드를 위한 'build', 그리고 보고된 동작 및 안전 어설션을 실행하는 'runtime'이 있습니다.
익스플로잇 체크가 실제로 취약점에 도달했는지 어떻게 확인할 수 있나요?
모든 익스플로잇 및 변형 체크는 코드 경로가 실행되었음을 증명하기 위해 어설션을 평가하기 직전에 'PPV_REACHED' 토큰을 stdout에 즉시 출력하고 flush해야 합니다.
이 SKILL을 운영 환경에서 실행해도 안전한가요?
아니요, 이 SKILL은 로컬 코드와 테스트만 실행하도록 설계되었습니다. 원격 또는 운영 대상에서는 사용해서는 안 됩니다.