arabelatso/static-vulnerability-detector
Statically analyze code to detect security vulnerabilities including buffer overflows, injection risks (SQL, command, XSS), insecure deserialization, improper authentication, hard-coded credentials, and unsafe cryptography. Use when: (1) Performing security code review, (2) Analyzing code for OWASP Top 10 vulnerabilities, (3) Identifying CWE-classified weaknesses, (4) Generating security audit reports, (5) Reviewing code before deployment, or (6) Assessing third-party code security. Findings categorized by CWE ID and severity (Critical/High/Medium/Low).
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill static-vulnerability-detector
Analyze code for security vulnerabilities with CWE classification and severity assessment.
Systematically examine code for vulnerability patterns:
Memory Safety (C/C++):
Injection Vulnerabilities:
Authentication & Authorization:
Cryptographic Issues:
Deserialization:
Input Validation:
For each vulnerability category, identify:
Dangerous Functions:
strcpy, sprintf, gets, scanfpickle.loads, eval, execos.system, subprocess with shell=TrueUnsafe Patterns:
Context Analysis:
Assign severity based on:
CRITICAL:
HIGH:
MEDIUM:
LOW:
Assess confidence in finding:
HIGH: Clear vulnerability pattern, no mitigating factors
MEDIUM: Vulnerability likely but context unclear
LOW: Potential issue requiring manual verification
Structure findings as:
## Vulnerability: [Title]
**ID**: VULN-[number]
**CWE**: CWE-[ID]
**Severity**: [CRITICAL/HIGH/MEDIUM/LOW]
**Confidence**: [HIGH/MEDIUM/LOW]
**Location**: [File:Line]
### Description
[What the vulnerability is]
### Code Snippet
[vulnerable code]
### Impact
- [Potential consequences]
### Remediation
[fixed code]
### References
- [CWE link]
- [OWASP reference]
Buffer Overflow (CWE-119):
// VULNERABLE
char buf[10];
strcpy(buf, user_input); // No bounds check
Use-After-Free (CWE-416):
// VULNERABLE
free(ptr);
ptr->field = value; // Use after free
SQL Injection (CWE-89):
# VULNERABLE
query = f"SELECT * FROM users WHERE id = {user_id}"
cursor.execute(query)
Command Injection (CWE-78):
# VULNERABLE
os.system("ping " + user_host)
XSS (CWE-79):
// VULNERABLE
element.innerHTML = user_input;
Missing Authentication (CWE-306):
# VULNERABLE
@app.route('/admin')
def admin_panel():
return render_template('admin.html') # No auth check
Hard-coded Credentials (CWE-798):
# VULNERABLE
PASSWORD = "admin123"
API_KEY = "sk-1234567890"
Weak Algorithm (CWE-327):
# VULNERABLE
hash = hashlib.md5(password.encode()).hexdigest()
Weak Random (CWE-330):
# VULNERABLE
token = random.randint(1000, 9999) # For security token
Untrusted Data (CWE-502):
# VULNERABLE
obj = pickle.loads(user_data) # RCE possible
Path Traversal (CWE-22):
# VULNERABLE
with open(f'/uploads/{filename}', 'r') as f: # ../../../etc/passwd
content = f.read()
SSRF (CWE-918):
# VULNERABLE
response = requests.get(user_url) # Can access internal services
Track tainted data from source to sink:
Sources (user input):
Sinks (dangerous operations):
Sanitization (check for):
Dangerous function calls:
Missing security controls:
Weak configurations:
For detailed vulnerability patterns and remediation, see cwe_patterns.md.
Key CWE categories:
# Security Vulnerability Report
**Scan Date**: [Date]
**Code Base**: [Project]
**Total Findings**: [Count]
## Severity Breakdown
- Critical: [Count]
- High: [Count]
- Medium: [Count]
- Low: [Count]
For each vulnerability:
Prioritized action items:
For complete vulnerability detection examples including:
See examples.md.
Take arabelatso/static-vulnerability-detector from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.