patcher-overview
Stage 4 patch generation playbook. Minimal diffs for validated findings with mandatory patch_verify. Load at patcher-agent startup.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-12
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- patcher-overview
- metadata
- { "subdomain": "orchestration", "when_to_use": "patcher stage 4 patch generation minimal diff validated finding patch_verify pipeline", "upstream_ref": "Decepticon vulnresearch pipeline — stage 4 patcher role" }
- description
- Stage 4 patch generation playbook. Minimal diffs for validated findings with mandatory patch_verify. Load at patcher-agent startup.
03 SKILL.md 正文
Patcher Skill
You fix validated findings and prove the fix holds. Minimal diffs, one
concern at a time, mandatory patch_verify before claiming done.
Iteration loop
while not patched and attempts < 3:
1. kg_query(kind="vulnerability", min_severity="medium")
→ pick validated=True, patched!=True
2. Read the function around (file, line)
3. Design minimal fix (validate / escape / parameterize / safe API)
4. patch_propose(vuln_id, diff, commit_message) → patch_id
5. Apply diff via Edit or bash patch
6. (optional) bash: run repo tests, abort on failure
7. patch_verify(patch_id, poc_command, success_patterns,
test_cmd=optional)
8. if status == "verified": done
elif status == "tests_failed": revert, retry
elif status == "regressed": revert, analyze, retry
attempts += 1
Diff style
- Unified diff. Use
git diff --no-coloroutput or write one by hand. - Minimal hunk. One concern. No formatting. No renames. No "while I'm here" cleanups. No new files (unless adding one regression test).
- Safe-API preference.
| Bug class | Preferred fix |
|---|---|
| SQL injection | Parameterized query / ORM.filter(), NOT escaping |
| Command injection | Arg-list subprocess, shell=False |
| Path traversal | os.path.realpath + prefix check |
| SSRF | Allowlist + resolve → check not private/loopback |
| Deserialization | Switch to safe loader (yaml.safe_load, JSON, etc.) |
| Broken auth | Move check to pre-hook, not inside handler |
| Reflected XSS | Framework auto-escape, remove Markup/safe |
- Add a regression test in the same diff when the repo has a test directory for the affected module. One test that exercises the fixed path is sufficient.
Commit message format
Conventional commits. Example:
fix(auth): use constant-time comparison in verify_hmac
Prevents timing side-channel recovery of the HMAC. CWE-208.
Decisive-completion rule
Only report "patched" after patch_verify.status == "verified". A
green test suite is NOT sufficient — the PoC must actually fail.
If all 3 attempts fail, STOP on the finding, record a note via
kg_add_node on the vuln (patch_attempts=3, last_failure=...) and
return to the orchestrator. Do not spiral.
04 同仓库更多 Skills
wps-pixie-dust
WPS Pixie-Dust offline nonce attack (reaver -K / pixiewps) and fallback online PIN brute (bully) to recover the AP's WPA PSK without capturing a handshake.
wpa3-sae
WPA3-SAE transition-mode downgrade (DragonShift), SSID Confusion CVE-2023-52424, Dragonblood side-channels, and SAE captive-portal credential recovery against WPA3-Personal networks.
wpa2-psk
WPA/WPA2-PSK handshake capture via targeted deauth + PMKID (no deauth required) + offline hashcat cracking. The most common consumer/SMB encryption mode in 2026.
wpa-enterprise-eap
WPA/WPA2/WPA3-Enterprise (802.1X/EAP) rogue-RADIUS evil-twin for MSCHAPv2 capture, GTC downgrade, and PEAP relay. MSCHAPv2 capture equals a NetNTLM hash — the primary wireless on-ramp to Active Directory.
krack-fragattacks
KRACK key-reinstallation (CVE-2017-13077..13082) and FragAttacks fragmentation/aggregation flaws (CVE-2020-24586..24588, CVE-2020-26139..26147) against legacy or embedded 802.11 supplicants with poor patch cadence.
evil-twin-karma
Evil-twin rogue AP with KARMA/Mana PNL-probe response, captive-portal credential capture, and post-association MITM for PSK/open networks. Distinct from wpa-enterprise-eap which targets 802.1X.