Fixes security issues by finding ID from the sec-audit report, verifies the fix, then updates findings.json and the report status; can also mark a finding as accepted risk or false positive. Use when the user says "sec-fix SEC-003", "fix SEC-001", "fix all the P0s" or "this one is a false positive / accepted risk".
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Sec Fix?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/57blocks-sec-fix-security-plugin)
---
name: sec-fix
description: >-
Fixes security issues by finding ID from the sec-audit report, verifies the fix, then updates findings.json and the report status; can also mark a finding as accepted risk or false positive.
Use when the user says "sec-fix SEC-003", "fix SEC-001", "fix all the P0s" or "this one is a false positive / accepted risk".
user-invocable: true
---
# sec-fix: fix audit findings one by one
## Input
- `sec-fix SEC-003`: fix one finding.
- `sec-fix P0` / `sec-fix P0 P1`: fix one by one in severity order, verifying each fix.
- `sec-fix SEC-003 accept "reason" by Jane Doe`: mark as accepted risk. `by` must be a person's name; ask if the user did not provide one; never fill in an AI.
- `sec-fix SEC-003 false-positive "reason"`: mark as false positive.
## Fix steps
1. Read the finding in `security-audit/findings.json` and the knowledge pack item its `category` points to (e.g. EVM-07 → `../sec-web3-evm/SKILL.md`; AI-xx and WEB-xx → the file named in the `../sec-ai-llm/SKILL.md` or `../sec-web/SKILL.md` index).
2. Read the code to confirm the issue still exists (it may have been resolved as a side effect of another fix).
3. Make a **minimal** fix: change only the necessary code, no opportunistic refactoring; change all locations of the same root cause together.
4. Verify against the **fix contract**. A fix is done only when all four hold:
1. **The original exploit fails**: re-run the finding's PoC (or live check); it must now fail for the right reason (the new check rejects it), not because of an unrelated error. Keep the PoC as a regression test. Contracts: the exploit test must now fail, and a `test_fixed_*` test asserting that the attack reverts or is unprofitable must pass; keep `test_fixed_*` as the regression test and attach the fix as a diff in `fixDiff`. A fix whose exploit test still passes is not done.
2. **The class fails, not just the sample**: try at least two variants of the input the fix should stop (another encoding, another field, another HTTP method, another ID shape, the sad paths in `../sec-audit/refs/threat-model.md` §3). Without a PoC, write a targeted test that covers them.
3. **Sibling entry points are fixed too**: every location in `location`, every finding with `variantOf` pointing here, and the parallel paths to the same resource (bulk, export, other API version, other transport, admin panel, job). List each and how it is covered.
4. **Behaviour is preserved**: the relevant existing tests pass, and the legitimate use the vulnerable code served still works (one test or a manual check you describe).
Re-check the changed files with the domain's scanner when the tool is available.
5. Look for **fake fixes** in your own change before calling it done:
| Pattern | Why it is not a fix |
|---|---|
| Check only in the frontend, client or UI | The server still accepts the request |
| Blocklist of bad values (`../`, `<script>`, `127.0.0.1`) | Encodings and alternatives pass; use an allowlist or a structural check |
| One endpoint, version or transport fixed | The same bug remains on its siblings |
| Authentication added where authorization was missing | Any logged-in user still reaches other users' data |
| Error suppressed or message changed | The behaviour behind the error is unchanged |
| Relies on a WAF, proxy rule or deployment setting not in this repo | Not enforced by the code under review; at most defense in depth |
| Validation added after the value was already used, or on a different value than the one used | Time-of-check/time-of-use or parser differential remains |
| Fixed in the default branch only, or behind a flag that defaults off | Deployed code is still vulnerable |
6. Check whether the fix introduces new issues (permissions, compatibility, storage layout, upgrade safety).
7. Record the verdict in `fixVerdict`:
- `closed`: all four contract points hold.
- `partial`: the original exploit fails but a variant, sibling path or the class check still succeeds; list what remains in `verification`.
- `not-fixed`: the original exploit still works.
- `regressed`: the fix breaks or re-opens another finding.
- `broken-by-fix`: the fix breaks legitimate behaviour.
Set `status: fixed` only for `closed`; otherwise keep `open` and explain in `verification`. Add `fixCommit` after the user commits.
8. Update the reports from `findings.json`; never edit `report-*.md` or `report-*.html` by hand.
1. Write the changes into `security-audit/findings.json` directly. Do not run assemble_findings.py: it rebuilds findings.json from the audit's per-finding files and its snapshot of the previous findings.json, so it would drop these changes.
2. Update the prose in `security-audit/report-text.json` that the scripts copy as written and cannot check against the new status: the current-status sentence of `client.summary`, and `internal.verdict` when it is set. Change only what the new status makes wrong; keep the rest, including limitations that still apply.
3. Render both reports with [render_report.py](../sec-core/scripts/render_report.py) (`python3 <path of that file> security-audit`). It recomputes the status column, counts and Resolution from `findings.json`.
4. Run [check_report.py](../sec-core/scripts/check_report.py) (`python3 <path of that file> security-audit`). Fix every error it prints in findings.json or report-text.json, then render and check again until it prints no errors.
## Accepted risk and false positive
- `accept`: set `status: accepted-risk`, `acceptedBy` (the person's name given by the user) and `acceptedReason`. The schema requires both fields; the reports show them in Resolution.
- `false-positive`: set `status: false-positive` and write the reason in `verification`. The client report leaves the finding out.
- Then update the reports as in step 8.
## Reply
In the project language (sec-core "Output language"; default English); text written into findings.json and the reports uses the same language.
- What was changed (file:line) and why it was fixed this way.
- Verification results against each of the four contract points, and the `fixVerdict`.
- Number of remaining P0/P1.
- Do not commit automatically; ask the user to review and commit.