security-vulnerability-fixer
Skill0 starsChanged 2 months agoMITView on GitHub
Guides agents through patching security vulnerabilities (SQL injection, path traversal, command injection, CVE audit alerts) cleanly.
In this repository49 other files it gives its agents.
- bug-reproducerSkill
- claim-checkerSkill
- command-failure-diagnoserSkill
- config-risk-reviewerSkill
- csv-validatorSkill
- deployment-checklist-makerSkill
- diff-reviewerSkill
- factual-summarizerSkill
- field-extractorSkill
- api-contract-testerSkill
- database-migration-helperSkill
- git-commit-stagerSkill
- git-conflict-resolverSkill
- github-actions-debuggerSkill
- github-issue-triagerSkill
- github-pr-creatorSkill
- github-pr-reviewerSkill
- go-code-qualitySkill
- go-lint-and-vetSkill
- go-testingSkill
- json-schema-converterSkill
- lint-and-typecheckSkill
- meaning-preserving-editorSkill
- meeting-notes-to-actionsSkill
- minimal-bug-fixSkill
- option-comparatorSkill
- py-code-qualitySkill
- py-lint-and-typecheckSkill
- py-testingSkill
- readme-writerSkill
- regression-test-writerSkill
- release-notes-drafterSkill
- repo-inspectorSkill
- research-briefSkill
- reversible-cleanup-plannerSkill
- rust-clippy-checkSkill
- rust-code-qualitySkill
- rust-testingSkill
- small-refactorSkill
- status-updateSkill
- step-by-step-tutorialSkill
- step-decomposerSkill
- tabular-analyzerSkill
- task-briefSkill
- test-runner-debuggerSkill
- ts-code-qualitySkill
- ts-lint-and-typecheckSkill
- ts-testingSkill
- skill-templateSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Very specific: line 20
Do not use for routine bug fixes without security impact.
- Distinctive: line 27
If file is unspecified: ask for file and line number.
- Distinctive: line 28
Never "fix" security issues by disabling validation or turning off authentication.
- Distinctive: line 31
Follow these numbered actions:
- Distinctive: line 37
Use language standard parameterized APIs.
- Distinctive: line 44
Always reject user-supplied file paths that resolve outside the intended root directory.
- Very specific: line 45
Never use eval() or exec() with unsanitized arguments.
- Distinctive: line 76
Stop and ask the user when:
- Very specific: line 100
if (!safePath.startsWith(BASE_DIR)) {
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security Vulnerability Fixer
Applies surgical security remediations for common OWASP vulnerabilities: SQL injection, path traversal, command injection, SSRF, and dependency CVEs.
1. Purpose
Eliminate security vulnerabilities without breaking legitimate application workflows.
2. When to Use
Use this skill when:
- Fixing static analysis security alerts (SonarQube, CodeQL, Snyk).
- Replacing string concatenation in SQL queries with parameterized statements.
- Sanitizing file paths to prevent directory traversal (
../).
3. When Not to Use
- Do not use for routine bug fixes without security impact; use
minimal-bug-fix.
4. Required Inputs
vulnerability_type: SQLi, Path Traversal, Command Injection, XSS, or Insecure Dependency.target_file: Source file containing the vulnerability.
5. Missing-Input Behavior
- If file is unspecified: ask for file and line number.
- Never "fix" security issues by disabling validation or turning off authentication.
6. Procedure
Follow these numbered actions:
- Action 1: Identify Flawed Pattern
- SQLi:
query("SELECT ... " + id)-> Parameterized query. - Path Traversal:
open(path)->Path.resolve()and verify prefix within base dir. - Command Injection:
exec("cmd " + arg)->execFile(["cmd", arg]).
- SQLi:
- Action 2: Apply Standard Remediation
- Use language standard parameterized APIs.
- Action 3: Run Automated Tests
- Confirm legitimate inputs continue to work.
- Action 4: Emit Security Report
- Format per Section 8.
7. Decision Rules
- Always reject user-supplied file paths that resolve outside the intended root directory.
- Never use
eval()orexec()with unsanitized arguments.
8. Output Format
Emit the report using this template:
### Security Vulnerability Patch: [Vulnerability Type]
- **Target File**: `[path:line]`
- **Severity**: [Critical | High | Medium]
- **Status**: PATCHED & VERIFIED
#### Remediation Diff
```diff
[Diff showing parameterized or sanitized fix]Verification Evidence
- [Test results showing fix works and blocks payload]
## 9. Verification Checklist
- [ ] Parameterized API or path resolution used.
- [ ] No regression on legitimate inputs.
- [ ] Test suite passes.
## 10. Common Failures and Recovery
| Failure Symptom | Cause | Recovery Action |
| :--- | :--- | :--- |
| Incomplete path sanitization | Stripping `../` with regex | Use canonical path resolution (`path.resolve()`) and check `startsWith(baseDir)`. |
## 11. Stop or Escalation Conditions
Stop and ask the user when:
- Remediation requires architectural overhaul of database communication layer.
## 12. Examples
### Example 1: Successful Execution
**Input:**
```text
File: src/files.ts:14
Vulnerability: Path traversal in readFile(req.query.path)Output:
### Security Vulnerability Patch: Path Traversal
- **Target File**: `src/files.ts:14`
- **Severity**: High
- **Status**: PATCHED & VERIFIED
#### Remediation Diff
```diff
- const fullPath = path.join(BASE_DIR, req.query.path);
+ const safePath = path.resolve(BASE_DIR, req.query.path);
+ if (!safePath.startsWith(BASE_DIR)) {
+ throw new ForbiddenError("Path traversal detected");
+ }Verification Evidence
- Verified path outside
BASE_DIRthrows 403 Forbidden.
### Example 2: Ambiguous or Missing Input
**Input:**
```text
Fix security.Output:
### Security Vulnerability Patch: Halted - No Target
- **Status**: Halted
Please provide the vulnerability type, target file, and line number.Example 3: Expected Final Output
Output:
### Security Vulnerability Patch: SQL Injection
- **Target File**: `src/db.py:22`
- **Severity**: Critical
- **Status**: PATCHED & VERIFIEDDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

