Proposes secure remediation strategies for detected security vulnerabilities including buffer overflows, injection risks, insecure deserialization, improper authentication, and unsafe cryptographic usage. Provides recommended security checks, safer API alternatives, design-level changes, code examples, trade-off analysis, and prioritized remediation plans. Does NOT automatically modify code unless explicitly requested.
71%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./skills/security-patch-advisor/SKILL.mdThis skill analyzes security vulnerabilities and provides comprehensive remediation strategies without automatically modifying code. It offers multiple remediation approaches with detailed trade-off analysis, code examples, and implementation guidance for vulnerabilities categorized by CWE (Common Weakness Enumeration) and severity.
Use this skill when you need:
Trigger scenarios:
When presented with a security vulnerability, analyze:
Context Gathering:
Questions to Consider:
Provide multiple remediation approaches:
Strategy Components:
Primary Remediation (recommended approach)
Alternative Approaches
Design-Level Changes
For Each Strategy, Include:
Provide concrete before/after examples:
Example Structure:
### Vulnerable Code
[Show the insecure code with clear vulnerability markers]
**Vulnerability:** CWE-XXX (Name)
**Risk:** [Explain the security risk]
**Attack Example:** [Show how it could be exploited]
### Remediated Code (Approach 1)
[Show the fixed code with security improvements]
**Changes:**
- [List specific changes made]
- [Explain security mechanisms added]
**Trade-offs:**
- ✅ [Benefits]
- ⚠️ [Limitations or considerations]
### Alternative Remediation (Approach 2)
[Show alternative fix if applicable]
**Trade-offs:**
- ✅ [Benefits]
- ⚠️ [Limitations or considerations]Provide step-by-step implementation instructions:
Guidance Should Include:
Prerequisites
Implementation Steps
Verification
Deployment Considerations
Help prioritize remediation efforts:
Prioritization Factors:
Priority Levels:
Common Remediations:
strncpy, snprintf)Common Remediations:
Common Remediations:
Common Remediations:
Common Remediations:
Common Remediations:
Common Remediations:
Structure your remediation advice as follows:
## Vulnerability Summary
- **Type:** [CWE-XXX: Name]
- **Severity:** [Critical/High/Medium/Low]
- **Location:** [File:Line or Component]
- **Impact:** [Brief description of security impact]
## Risk Analysis
[Explain the security risk, attack vectors, and potential impact]
## Recommended Remediation (Primary)
[Detailed description of the recommended fix]
### Code Example
[Before/after code showing the fix]
### Implementation Steps
1. [Step 1]
2. [Step 2]
...
### Trade-offs
- ✅ [Benefits]
- ⚠️ [Considerations]
## Alternative Approaches
### Alternative 1: [Name]
[Description and code example]
**Trade-offs:**
- ✅ [Benefits]
- ⚠️ [Considerations]
### Alternative 2: [Name]
[Description and code example]
**Trade-offs:**
- ✅ [Benefits]
- ⚠️ [Considerations]
## Design-Level Improvements
[Architectural or system-level changes to consider]
## Verification & Testing
[How to verify the fix and test for regressions]
## Priority Recommendation
**Priority Level:** [P0/P1/P2/P3]
**Rationale:** [Why this priority level]
**Timeline:** [Suggested remediation timeline]
## Additional Resources
[Links to relevant security standards, documentation, or tools]User: "I found a SQL injection vulnerability in our login function. Here's the code: query = "SELECT * FROM users WHERE username = '" + username + "'""
Response:
## Vulnerability Summary
- **Type:** CWE-89: SQL Injection
- **Severity:** Critical
- **Location:** Login function
- **Impact:** Attackers can bypass authentication, extract database contents, or modify data
## Risk Analysis
The login function constructs SQL queries using string concatenation with user-supplied input. An attacker can inject SQL commands by providing specially crafted input like `' OR '1'='1` to bypass authentication or `'; DROP TABLE users; --` to execute destructive commands.
## Recommended Remediation (Parameterized Queries)
Use parameterized queries (prepared statements) to separate SQL logic from data:
### Code Example
**Vulnerable Code:**
```python
query = "SELECT * FROM users WHERE username = '" + username + "'"
cursor.execute(query)Remediated Code:
query = "SELECT * FROM users WHERE username = ?"
cursor.execute(query, (username,))execute()Use an Object-Relational Mapping framework:
user = User.query.filter_by(username=username).first()Trade-offs:
Encapsulate SQL logic in stored procedures:
cursor.callproc('sp_authenticate_user', (username,))Trade-offs:
' OR '1'='1, '; DROP TABLE users; --Priority Level: P0 (Critical) Rationale: SQL injection in authentication is critical severity, allows complete system compromise Timeline: Fix immediately (within 24 hours)
## Resources
### references/remediation_strategies.md
Comprehensive remediation patterns organized by vulnerability category, including:
- Buffer overflow mitigations
- Injection prevention techniques
- Secure deserialization approaches
- Authentication and authorization best practices
- Cryptographic recommendations
- Memory safety strategies
- Configuration security
### references/examples.md
Complete before/after remediation examples with detailed explanations:
- SQL injection fixes (parameterized queries, ORMs)
- Command injection prevention (subprocess, library alternatives)
- Buffer overflow mitigations (bounds checking, safe functions)
- XSS prevention (output encoding, CSP, templates)
- Insecure deserialization fixes (JSON, signed data)
- Weak cryptography upgrades (bcrypt, Argon2)
- Authentication improvements (rate limiting, session management)
- Authorization enforcement (ownership checks, RBAC)
- Hard-coded credential removal (environment variables, secret management)
- Path traversal prevention (validation, whitelisting)ArabelaTso/Skills-4-SE
4f38503
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.