mcpbeat Sign in

Static Vulnerability Detector Skill for Cursor

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).

7k tokens
context cost
the whole folder, loaded on every use
3
files
instructions only
0
copies elsewhere
how many repositories repackaged it
141
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill static-vulnerability-detector

The instruction itself

24 sections, as written by the author

Static Vulnerability Detector

Analyze code for security vulnerabilities with CWE classification and severity assessment.

Analysis Workflow

1. Code Scanning

Systematically examine code for vulnerability patterns:

Memory Safety (C/C++):

  • Buffer overflows (CWE-119)
  • Out-of-bounds access (CWE-125)
  • Use-after-free (CWE-416)
  • Double free (CWE-415)
  • Null pointer dereference (CWE-476)

Injection Vulnerabilities:

  • SQL injection (CWE-89)
  • Command injection (CWE-78)
  • Cross-site scripting (CWE-79)
  • XML injection (CWE-91)
  • LDAP injection (CWE-90)

Authentication & Authorization:

  • Missing authentication (CWE-306)
  • Improper authentication (CWE-287)
  • Missing authorization (CWE-862)
  • Hard-coded credentials (CWE-798)

Cryptographic Issues:

  • Weak algorithms (CWE-327)
  • Inadequate encryption (CWE-326)
  • Weak random values (CWE-330)
  • Missing encryption (CWE-311)

Deserialization:

  • Untrusted deserialization (CWE-502)
  • Mass assignment (CWE-915)

Input Validation:

  • Improper validation (CWE-20)
  • Path traversal (CWE-22)
  • SSRF (CWE-918)

2. Pattern Matching

For each vulnerability category, identify:

Dangerous Functions:

  • C/C++: strcpy, sprintf, gets, scanf
  • Python: pickle.loads, eval, exec
  • SQL: String concatenation in queries
  • Shell: os.system, subprocess with shell=True

Unsafe Patterns:

  • Unvalidated user input
  • Missing bounds checking
  • Weak cryptographic algorithms
  • Hard-coded secrets
  • Missing authentication decorators

Context Analysis:

  • Data flow from user input to sink
  • Sanitization and validation presence
  • Authentication/authorization checks
  • Error handling adequacy

3. Severity Assessment

Assign severity based on:

CRITICAL:

  • Remote code execution possible
  • Authentication bypass
  • SQL injection with admin access
  • Arbitrary file read/write

HIGH:

  • Privilege escalation
  • Sensitive data exposure
  • Hard-coded credentials
  • Weak cryptography for sensitive data

MEDIUM:

  • Information disclosure
  • Denial of service
  • Missing input validation
  • Insecure configuration

LOW:

  • Minor information leaks
  • Verbose error messages
  • Missing security headers

4. Confidence Level

Assess confidence in finding:

HIGH: Clear vulnerability pattern, no mitigating factors

MEDIUM: Vulnerability likely but context unclear

LOW: Potential issue requiring manual verification

5. Generate Report

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]

Vulnerability Categories

Memory Safety (C/C++)

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

Injection Attacks

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;

Authentication Issues

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"

Cryptographic Weaknesses

Weak Algorithm (CWE-327):

# VULNERABLE
hash = hashlib.md5(password.encode()).hexdigest()

Weak Random (CWE-330):

# VULNERABLE
token = random.randint(1000, 9999)  # For security token

Deserialization

Untrusted Data (CWE-502):

# VULNERABLE
obj = pickle.loads(user_data)  # RCE possible

Input Validation

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

Detection Heuristics

Data Flow Analysis

Track tainted data from source to sink:

Sources (user input):

  • HTTP parameters, headers, body
  • Command-line arguments
  • File contents
  • Environment variables
  • Database queries

Sinks (dangerous operations):

  • SQL query execution
  • System command execution
  • File operations
  • HTML output
  • Deserialization

Sanitization (check for):

  • Input validation
  • Escaping/encoding
  • Parameterized queries
  • Whitelist filtering

Pattern Recognition

Dangerous function calls:

  • Without input validation
  • With user-controlled arguments
  • In security-sensitive contexts

Missing security controls:

  • No authentication decorator
  • No authorization check
  • No CSRF protection
  • No rate limiting

Weak configurations:

  • Debug mode enabled
  • Verbose errors
  • Insecure defaults

CWE Reference

For detailed vulnerability patterns and remediation, see cwe_patterns.md.

Key CWE categories:

  • Memory safety (CWE-119, 125, 416, 415)
  • Injection (CWE-89, 78, 79, 91)
  • Authentication (CWE-287, 306, 798, 862)
  • Cryptography (CWE-327, 326, 330, 311)
  • Deserialization (CWE-502, 915)
  • Input validation (CWE-20, 22, 918)

Report Format

Summary Section

# Security Vulnerability Report

**Scan Date**: [Date]
**Code Base**: [Project]
**Total Findings**: [Count]

## Severity Breakdown
- Critical: [Count]
- High: [Count]
- Medium: [Count]
- Low: [Count]

Detailed Findings

For each vulnerability:

  • Unique ID
  • CWE classification
  • Severity and confidence
  • Location (file, line, function)
  • Description
  • Code snippet
  • Impact assessment
  • Remediation guidance
  • References

Recommendations

Prioritized action items:

  • Fix critical vulnerabilities immediately
  • Address high-severity issues
  • Plan remediation for medium/low issues
  • Implement security best practices

Examples

For complete vulnerability detection examples including:

  • SQL injection analysis
  • Buffer overflow detection
  • Hard-coded credentials
  • Insecure deserialization
  • Missing authentication
  • Weak cryptography

See examples.md.

Analysis Tips

  • Context matters: Consider surrounding code and mitigations
  • False positives: Mark uncertain findings as low confidence
  • Data flow: Trace user input to dangerous sinks
  • Defense in depth: Note multiple security layers
  • Language-specific: Apply appropriate patterns per language
  • Framework awareness: Consider framework protections
  • Configuration: Check for insecure settings
  • Dependencies: Note vulnerable library versions
  • Completeness: Scan all code paths
  • Prioritize: Focus on critical and high severity first

Other skills for the same job

different authors, same section of the catalogue
Backend Security Coder
by ComeOnOliver
×2

Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use PROACTIVELY for backend security implementations or security code reviews.

5k tokens
Cloud Penetration Testing
by ComeOnOliver
×2

This skill should be used when the user asks to "perform cloud penetration testing", "assess Azure or AWS or GCP security", "enumerate cloud resources", "exploit cloud misconfigurations", "test O365 security", "extract secrets from cloud environments", or "audit cloud infrastructure". It provides comprehensive techniques for security assessment across major cloud platforms.

16k tokens
Codebase Cleanup Deps Audit
by ComeOnOliver
×2

You are a dependency security expert specializing in vulnerability scanning, license compliance, and supply chain security. Analyze project dependencies for known vulnerabilities, licensing issues, outdated packages, and provide actionable remediation strategies.

10k tokens
Flow Nexus Platform
by ComeOnOliver
×2

Comprehensive Flow Nexus platform management - authentication, sandboxes, app deployment, payments, and challenges

14k tokens
Linux Privilege Escalation
by ComeOnOliver
×2

This skill should be used when the user asks to "escalate privileges on Linux", "find privesc vectors on Linux systems", "exploit sudo misconfigurations", "abuse SUID binaries", "exploit cron jobs for root access", "enumerate Linux systems for privilege escalation", or "gain root access from low-privilege shell". It provides comprehensive techniques for identifying and exploiting privilege escalation paths on Linux systems.

8k tokens
Malware Analyst
by ComeOnOliver
×2

Expert malware analyst specializing in defensive malware research, threat intelligence, and incident response. Masters sandbox analysis, behavioral analysis, and malware family identification. Handles static/dynamic analysis, unpacking, and IOC extraction. Use PROACTIVELY for malware triage, threat hunting, incident response, or security research.

4k tokens
Metasploit Framework
by ComeOnOliver
×2

This skill should be used when the user asks to "use Metasploit for penetration testing", "exploit vulnerabilities with msfconsole", "create payloads with msfvenom", "perform post-exploitation", "use auxiliary modules for scanning", or "develop custom exploits". It provides comprehensive guidance for leveraging the Metasploit Framework in security assessments.

7k tokens
Mobile Security Coder
by ComeOnOliver
×2

Expert in secure mobile coding practices specializing in input validation, WebView security, and mobile-specific security patterns. Use PROACTIVELY for mobile security implementations or mobile security code reviews.

6k tokens

How to use it

Copy the folder

Take arabelatso/static-vulnerability-detector from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

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.