Chuyển đến nội dung
Skillpedia
Bảo mật6.5k · #13900

patcher-overview

Skill này làm gì

Skill này hướng dẫn một agent sửa các lỗi bảo mật đã xác nhận bằng thay đổi code tối thiểu, rồi chạy lại kiểm tra. Nó dành cho nhà phát triển trong quy trình bảo mật Decepticon.

Khi nào nên dùng

  • ✓Khi một công cụ quét bảo mật đã xác nhận một lỗi và cần một bản sửa nhỏ, tập trung.
  • ✓Khi bạn muốn một bản sửa được đề xuất được kiểm tra lại trước khi đánh dấu là xong.
  • ✓Khi một bản sửa gây hồi quy và cần được hoàn tác rồi thử lại.

Liên kết skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/plugins/patcher/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/plugins/patcher/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chúng tôi đã xác nhận một SQL injection trong trang tìm kiếm. Bạn có thể viết bản sửa nhỏ nhất và kiểm tra nó hoạt động không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent đọc code quanh từng lỗi, đề xuất một thay đổi tối thiểu dùng cách an toàn, áp dụng nó, rồi chạy lại proof of concept và test trước khi chấp nhận.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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-color output 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.

Câu hỏi thường gặp

Nó có viết lại toàn bộ file không?

Không. Nó làm việc với một mối quan tâm mỗi lần, với thay đổi tối thiểu và không dọn dẹp những thứ không liên quan.

Cách sửa ưu tiên cho SQL injection là gì?

Dùng truy vấn tham số hóa hoặc bộ lọc ORM thay vì tự thoát đầu vào bằng tay.

Nếu test thất bại thì sao?

Agent hoàn tác thay đổi, phân tích kết quả và thử lại, tối đa ba lần.

Chi tiết

Mô tả gốc của tác giả

Stage 4 patch generation playbook. Minimal diffs for validated findings with mandatory patch_verify. Load at patcher-agent startup.

repo: BitterSecurity/Decepticon

Độ phổ biến

Sao GitHub
6.5k
Vị trí xếp hạng
#13900
Giấy phép
Apache-2.0
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự