MCP HubMCP Hub
返回技能列表

Static Vulnerability Analysis

macaugh
更新于 Today
4 次查看
2
2
在 GitHub 上查看
开发general

关于

This skill performs static vulnerability analysis by examining source code without execution to identify security flaws. It combines automated pattern matching with manual code review to find issues like memory safety problems and logic flaws. Use it when source code is available, before dynamic testing, or during security code reviews for languages including C/C++, Java, Python, JavaScript, and PHP.

技能文档

Static Vulnerability Analysis

Overview

Static analysis examines source code without executing it, identifying security vulnerabilities through pattern matching, data flow analysis, and manual code review. This technique is essential for finding logic flaws, authentication bypasses, and subtle vulnerabilities that automated tools might miss.

Core principle: Combine automated tools with manual review. Tools find patterns; humans find logic flaws.

Common Vulnerability Patterns

Memory Safety Issues (C/C++)

// Buffer Overflow
char buffer[256];
strcpy(buffer, user_input);  // ❌ Unsafe
strncpy(buffer, user_input, sizeof(buffer)-1);  // ✓ Safer

// Integer Overflow
size_t alloc = user_count * item_size;  // ❌ Can overflow
void *ptr = malloc(alloc);

// Use After Free
free(ptr);
ptr->field = value;  // ❌ Use after free

// Double Free
free(ptr);
free(ptr);  // ❌ Double free

Injection Vulnerabilities

# SQL Injection
query = f"SELECT * FROM users WHERE name = '{user_input}'"  # ❌
cursor.execute(query)

# Safe: Parameterized queries
cursor.execute("SELECT * FROM users WHERE name = ?", (user_input,))  # ✓

# Command Injection
os.system(f"ping {user_input}")  # ❌

# Safe: Use subprocess with list
subprocess.run(["ping", user_input])  # ✓

# Path Traversal
filepath = f"/data/{user_filename}"  # ❌ ../../../etc/passwd
open(filepath, 'r')

# Safe: Validate and use os.path.join with validation

Authentication and Authorization

# Broken Authentication
if username == "admin" and password == config.ADMIN_PASSWORD:  # ❌ Timing attack
    grant_access()

# Better: Use constant-time comparison
import hmac
if hmac.compare_digest(username, "admin") and \
   hmac.compare_digest(password, config.ADMIN_PASSWORD):
    grant_access()

# Authorization Bypass
def get_user_data(user_id):
    # ❌ No authorization check
    return database.get_user(user_id)

# Better: Check authorization
def get_user_data(user_id):
    if current_user.id != user_id and not current_user.is_admin:
        raise UnauthorizedException()
    return database.get_user(user_id)

Automated Tools

# Semgrep - Pattern-based analysis
semgrep --config=auto /path/to/source

# Bandit - Python security linter
bandit -r /path/to/python/code

# ESLint with security plugins - JavaScript
eslint --plugin security /path/to/js

# Brakeman - Ruby on Rails
brakeman /path/to/rails/app

# FindSecBugs - Java
# SpotBugs with FindSecBugs plugin

# SonarQube - Multi-language
sonar-scanner

Manual Review Checklist

  • Input validation on all user-controlled data
  • Authentication mechanisms (session management, password storage)
  • Authorization checks (IDOR, privilege escalation)
  • Cryptographic implementations (weak algorithms, hardcoded keys)
  • Error handling (information disclosure)
  • Business logic flaws
  • Race conditions and time-of-check-time-of-use
  • Sensitive data exposure (logs, error messages)

Data Flow Analysis

# Trace tainted data from source to sink
# SOURCE: User input
# SINK: Dangerous operation

# Example:
user_input = request.GET['file']  # SOURCE
# ... no validation ...
content = open(user_input).read()  # SINK

# Finding: Path traversal vulnerability
# No validation between source and sink

Integration with Other Skills

  • skills/analysis/zero-day-hunting - Comprehensive vulnerability research
  • skills/exploitation/exploit-dev-workflow - Exploitation of found vulnerabilities
  • skills/documentation/* - Document findings

快速安装

/plugin add https://github.com/macaugh/super-rouge-hunter-skills/tree/main/static-vuln-analysis

在 Claude Code 中复制并粘贴此命令以安装该技能

GitHub 仓库

macaugh/super-rouge-hunter-skills
路径: skills/analysis/static-vuln-analysis

相关推荐技能

analyzing-dependencies

这个Claude Skill能自动分析项目依赖的安全漏洞、过时包和许可证合规问题。它支持npm、pip、composer、gem和go modules等多种包管理器,帮助开发者识别潜在风险。当您需要检查依赖安全性、更新过时包或确保许可证兼容时,可使用"check dependencies"等触发短语来调用。

查看技能

work-execution-principles

其他

这个Claude Skill为开发者提供了一套通用的工作执行原则,涵盖任务分解、范围确定、测试策略和依赖管理。它确保开发活动中的一致质量标准,适用于代码审查、工作规划和架构决策等场景。该技能与所有编程语言和框架兼容,帮助开发者系统化地组织代码结构和定义工作边界。

查看技能

Git Commit Helper

Git Commit Helper能通过分析git diff自动生成规范的提交信息,适用于开发者编写提交消息或审查暂存区变更时。它能识别代码变更类型并自动匹配Conventional Commits规范,提供包含功能类型、作用域和描述的标准化消息。开发者只需提供git diff内容即可获得即用型的提交消息建议。

查看技能

nextjs

开发

This Next.js Skill provides architectural standards and BFF patterns for Next.js 15.5+ projects using App Router. It enforces clear server/client component separation, implements Server Actions and Route Handlers, and ensures performance optimization with SEO best practices. Use it when designing App Router structures, implementing data fetching strategies, or building BFF architectures.

查看技能