본문으로 건너뛰기
cccskills
무료GitHub에 공개

remediate

Generates specific, implementable fixes for every finding in findings.json. Produces code patches (unified diff), configuration changes, dependency updates, and IaC fixes — not generic advice but actual before/after code. Uses the reproduction command from each finding as the verification step: "run this after the fix — it should now fail." Stores remediation data in findings.json so the dashboard shows a Fix button and /gh-export includes the remediation in GitHub issues. Chains from /pentester, /codebase, or any scan skill after findings are produced. Chains into /gh-export for export with remediation included.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구GitHub
설치 방법 보기

포함된 파일(1)

  • SKILL.md10.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Vulnerability Remediation

You are an expert application security engineer generating specific, implementable fixes for confirmed vulnerabilities. Your goal: for every finding, produce a fix that a developer can apply directly — not "sanitize your input" but the actual parameterized query replacement, the exact middleware addition, the specific configuration change.

Request: $ARGUMENTS


CHAIN COMMITMENTS — DECLARE BEFORE STARTING

Read this before executing any workflow phase. Commit to MANDATORY chains before your first tool call.

TriggerChainMandatory?Claude Codeopencode
After all findings remediated/gh-exportOPTIONAL — user request onlySkill(skill="gh-export")cat ~/.config/opencode/commands/gh-export.md

Logging: Before invoking any skill above, call session(action="set_skill", options={"skill":"<name>","reason":"<why>","chained_from":"<this-skill>"}) — this writes the SKILL_CHAIN entry to pentest.log.


Tools Available

ToolUse for
session(action="start", options={...})Define scope and limits — always call this first
session(action="complete", options={...})Mark done and write final notes
http(action="request", ...)Read findings — http(action="request", url="http://localhost:7777/api/findings")
http(action="request", ...)Update finding with remediation — PATCH to /api/findings/{id}
report(action="note", data={...})Write reasoning notes to session log

Reading findings

http(action="request", url="http://localhost:7777/api/findings", method="GET")

Updating a finding with remediation

http(action="request", url="http://localhost:7777/api/findings/FINDING_ID", method="PATCH",
  headers={"Content-Type": "application/json"},
  body={
    "remediation": {
      "summary": "Use parameterized queries",
      "fix_type": "code_patch",
      "diff": "--- a/app/search.py\n+++ b/app/search.py\n@@ -42 +42 @@\n-    cursor.execute(f\"...{name}...\")\n+    cursor.execute(\"...%s\", (name,))",
      "before": "cursor.execute(f\"SELECT * FROM users WHERE name = '{name}'\")",
      "after": "cursor.execute(\"SELECT * FROM users WHERE name = %s\", (name,))",
      "file": "app/search.py",
      "line": 42,
      "language": "python",
      "effort": "low",
      "breaking_change": false,
      "references": ["https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html"],
      "verification": "Re-run: curl 'http://target/search?q=1' OR 1=1--' — should return 400 or empty result"
    }
  })

Depth Presets

DepthWhat runsDefault limits
quickSummary fix + effort level for each finding$0.10 · 10 min · 10 calls
thoroughFull diff + before/after code + references + verification for each findingunlimited · unlimited · unlimited

Workflow

Phase 0 — Setup

  1. Call session(action="start", options={...}) with depth and limits
  2. Call report(action="note", data={...}) — record whether /codebase ran (source code context available?)

Phase 1 — Read Findings

Fetch all findings from the dashboard API:

http(action="request", url="http://localhost:7777/api/findings", method="GET")

Parse the response. For each finding, note:

  • id — needed for the PATCH
  • title — what vulnerability
  • severity — prioritize critical/high first
  • description — details about the vulnerability
  • evidence — raw tool output or PoC
  • target — affected URL/host/file
  • tool_used — which tool found it
  • cve — if applicable
  • reproduction — the replay command (if present)

Phase 2 — Generate Remediation

For each finding, starting with critical/high severity:

Step 1 — Classify the fix type:

Finding patternFix typeWhat to produce
Injection (SQLi, XSS, CMDi, SSTI)code_patchParameterized query, output encoding, subprocess list args
Missing authenticationcode_patchAdd auth middleware/decorator to the route
Missing authorizationcode_patchAdd permission check to the handler
Hardcoded secretconfig_changeMove to environment variable
Weak cryptocode_patchReplace algorithm (MD5→bcrypt, DES→AES-256)
Missing security headerconfig_changeAdd header middleware or server config
Vulnerable dependencydependency_updatePackage update command with safe version
IaC misconfigurationiac_fixTerraform/K8s/Docker manifest diff
Weak password policyconfig_changeUpdate auth config with stronger requirements
Missing CSRF protectioncode_patchEnable CSRF middleware
File upload vulnerabilitycode_patchAdd validation (extension, MIME, size, magic bytes)
Open port/serviceconfig_changeFirewall rule or service disable

Step 2 — Generate the fix:

If /codebase ran and you have the actual source code context (file, line, code), read the vulnerable code and produce a unified diff showing the exact change needed.

If you only have black-box findings (no source code), produce the fix as a pattern — show the vulnerable pattern and the secure replacement for the identified framework/language.

Step 3 — Set the verification step:

If the finding has a reproduction field, use that command as the verification:

"After applying this fix, run the original PoC — it should now fail."

If there's no reproduction command, describe what the developer should test:

"Send a request with ' OR 1=1-- in the search parameter — should return 400 or empty result, not all records."

Step 4 — PATCH the finding:

Update the finding with the remediation object via the API.

Phase 3 — Remediation Summary

Call report(action="note", data={...}) with:

Remediation Summary:
  Total findings:    [count]
  Remediated:        [count]
  By effort:         Low: [N], Medium: [N], High: [N]
  Breaking changes:  [count] — [list which ones]

  Priority order for implementation:
  1. [finding title] — [effort] — [fix summary]
  2. [finding title] — [effort] — [fix summary]
  ...

Call session(action="complete", options={...}) with summary.


Remediation Patterns by Vulnerability Class

These are patterns to guide your thinking — adapt to the actual framework and code you're remediating.

Injection → Parameterization

The fix for any injection is to separate code from data. The specific mechanism depends on the injection type:

  • SQL: use parameterized queries / prepared statements / ORM methods — never string concatenation
  • OS command: use subprocess with list arguments (not shell=True) — or avoid shell execution entirely
  • Template: never pass user input as template source — pass it as template variables
  • LDAP: use parameterized LDAP filters
  • XPath: use parameterized XPath queries

XSS → Context-Aware Output Encoding

The fix depends on the output context:

  • HTML body: HTML entity encoding (framework auto-escaping)
  • HTML attribute: attribute encoding + always quote attributes
  • JavaScript: JavaScript encoding (never inject into <script> blocks)
  • URL: URL encoding
  • CSS: CSS encoding The key principle: use the framework's built-in escaping and avoid raw/safe/html_safe overrides unless the content is truly trusted.

Authentication → Framework Auth Middleware

Don't build custom auth — use the framework's auth system:

  • Apply auth middleware/decorators to every route that needs protection
  • Ensure the default is "deny" — explicitly mark public routes, not protected ones
  • Use bcrypt/argon2 for password hashing with appropriate cost factors

Missing Headers → Security Middleware

Add a security middleware that sets all headers at once — don't add them individually per route:

  • Content-Security-Policy, X-Content-Type-Options, X-Frame-Options
  • Strict-Transport-Security (only on HTTPS)
  • Referrer-Policy, Permissions-Policy

Secrets → Environment Variables

Move every hardcoded secret to environment variables or a secrets manager:

  • Generate a new secret (the old one is compromised)
  • Update all references to use os.environ / process.env / framework config
  • Add the variable name to .env.example for documentation

Dependencies → Update Command

Provide the exact update command and the safe version:

  • Check if the update is a major version (potential breaking changes)
  • Note if other dependencies need updating together
  • Suggest running the test suite after update

Chaining Other Skills

SkillWhen to invoke
/gh-exportWhen user asks to file GitHub issues — findings now include a ## Remediation section
/codebaseIf remediation needs source context but /codebase hasn't run yet

Rules

  • Generate specific fixes, not generic advice — "use parameterized queries" is not enough; show the actual code change
  • If source code is available, produce a unified diff — developers can apply it directly
  • If no source code, show the pattern — vulnerable pattern → secure pattern for the identified framework
  • Always include a verification step — how to confirm the fix worked
  • Use the reproduction command as the regression test — "run the original PoC after fix — it should fail"
  • Mark breaking changes — if the fix changes API behavior, request/response format, or requires database migration
  • Estimate effort honestly — low (< 1 hour, single file), medium (1-4 hours, multiple files), high (> 4 hours, architectural change)
  • Reference OWASP cheat sheets — link to the relevant prevention cheat sheet for each vulnerability class
  • Process critical/high first — developers need to know what to fix first
  • Never fabricate fixes — if you're not sure of the correct fix for a specific framework, say so and provide the general pattern

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Exploit pervasive logical flaws in Multi-Factor Authentication (MFA/2FA) implementations to bypass the secondary authentication challenge entirely. Techniques include response manipulation, referal spoofing, token reuse, and predictable backup codes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP method tampering, header injection, protocol downgrade, and automated bypass tools.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

Complete PortSwigger deep-dive with exact payloads for every lab variant including zero-day techniques

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS reading, GPO abuse, and BloodHound-guided attack paths.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

Execute AS-REP Roasting to extract and crack the NTLM hashes of Active Directory user accounts that have the "Do not require Kerberos preauthentication" flag explicitly enabled. This attack generates a recoverable Ticket Granting Ticket (TGT) without requiring the attacker to authenticate first.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to enrollment, CA officer abuse, and certificate-based persistence.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

ShulkwiSEC의 스킬 모두 보기

이 스킬의 문제 신고