npx skills add https://github.com/sendaifun/skills --skill vulnhunter一个全面的安全审计技能,用于识别危险 API、易误用模式、易错配置,并在代码库中搜索漏洞变体。灵感来源于 Trail of Bits 的"锋利边缘"和变体分析方法论。
VulnHunter 结合了两种强大的安全分析技术:
在以下场景激活此技能:
查找默认情况下不安全的配置:
- CORS: Access-Control-Allow-Origin: *
- 生产环境中启用的调试模式
- 默认凭据或 API 密钥
- 宽松的文件权限 (777, 666)
- 禁用的 SSL/TLS 验证
- 不安全的反序列化设置
内存安全:
// 危险:无边界检查
strcpy(), strcat(), sprintf(), gets()
memcpy() 无大小验证
// 更安全的替代方案
strncpy(), strncat(), snprintf(), fgets()
memcpy_s() 带明确大小
加密学陷阱:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
- ECB 模式加密
- 用于安全目的的 MD5/SHA1
- 硬编码的 IV 或盐值
- 自定义加密实现
- 非 CSPRNG 的随机数 (用于令牌的 Math.random)
并发问题:
- 文件操作中的竞态条件
- 检查时间到使用时间 (TOCTOU)
- 双重检查锁定反模式
- 非原子递增/递减操作
JavaScript/TypeScript:
// 危险模式
eval(), new Function(), setTimeout(string)
innerHTML, outerHTML, document.write()
Object.assign() 用于深克隆 (仅为浅克隆!)
== 而不是 === (类型强制转换)
Python:
# 危险模式
pickle.loads(untrusted) # RCE 向量
yaml.load(untrusted) # 使用 safe_load
exec(), eval()
os.system(), subprocess 带 shell=True
Rust:
// 需要额外审查的模式
unsafe { }
.unwrap() 在生产代码中
mem::transmute()
原始指针解引用
Solidity/智能合约:
// 高风险模式
tx.origin 用于身份验证 // 易受钓鱼攻击
delegatecall 到不受信任的地址 // 存储冲突
selfdestruct // 永久销毁
block.timestamp 用于随机性 // 矿工可操纵
审查代码时,系统性地检查:
原始漏洞:用户输入未经净化直接流向 SQL 查询
模式:[user_input] -> [sink_function] 没有 [validation_function]
搜索:
- 使用字符串拼接的直接数据库调用
- 带有用户参数的 ORM 原始查询方法
- 相邻模块中的类似数据流
原始漏洞:端点缺少身份验证中间件
模式:路由定义没有身份验证装饰器/中间件
搜索:
- 在易受攻击路由之后定义的路由
- 其他模块中的类似 API 模式
- 管理员/内部端点
原始漏洞:检查后执行缺乏原子性
模式:if (check_condition()) { act_on_condition() }
搜索:
- 文件存在性检查后跟文件操作
- 权限检查后跟特权操作
- 余额检查后跟转账
# 查找潜在的 SQL 注入
grep -rn "execute.*%s" --include="*.py"
grep -rn "query.*\+" --include="*.js"
# 查找危险的反序列化
grep -rn "pickle.loads\|yaml.load\|eval(" --include="*.py"
# 查找命令注入向量
grep -rn "os.system\|subprocess.*shell=True" --include="*.py"
为了更精确的匹配,使用基于 AST 的工具:
## 变体分析报告
### 原始发现
- **ID**: FINDING-001
- **严重性**: 高
- **根本原因**: [描述]
- **受影响文件**: path/to/file.ext:line
### 提取的模式
[代码模式或正则表达式]
### 发现的变体
| # | 位置 | 严重性 | 状态 | 备注 |
|---|----------|----------|--------|-------|
| 1 | file.ext:42 | 高 | 已确认 | 相同根本原因 |
| 2 | other.ext:100 | 中 | 疑似 | 需要验证 |
### 建议
[系统性的修复方法]
# 示例:检测 Python 中的 SQL 注入
rules:
- id: sql-injection-format
patterns:
- pattern: $CURSOR.execute($QUERY % ...)
message: "通过字符串格式化的潜在 SQL 注入"
severity: ERROR
languages: [python]
// 查找流向危险接收器的受污染数据
import python
import semmle.python.dataflow.TaintTracking
from DataFlow::PathNode source, DataFlow::PathNode sink
where TaintTracking::localTaint(source.getNode(), sink.getNode())
and sink.getNode().asExpr().(Call).getTarget().getName() = "execute"
select sink, source, sink, "受污染的输入到达 SQL 执行"
查看 /examples 文件夹以获取:
resources/sharp-edges-catalog.md - 危险模式的综合目录resources/variant-patterns.md - 常见漏洞模式模板templates/variant-report.md - 变体分析报告模板vulnhunter/
├── SKILL.md # 本文件
├── resources/
│ ├── sharp-edges-catalog.md # 分类的危险模式
│ └── variant-patterns.md # 漏洞模式模板
├── examples/
│ ├── smart-contracts/ # Solidity/区块链示例
│ ├── web-apps/ # Web 应用程序示例
│ └── native-code/ # C/C++/Rust 示例
├── templates/
│ └── variant-report.md # 分析报告模板
└── docs/
└── methodology.md # 详细的方法论指南
每周安装量
74
仓库
GitHub 星标数
68
首次出现
2026 年 1 月 24 日
安全审计
安装于
codex70
gemini-cli68
opencode67
github-copilot65
amp64
kimi-cli64
A comprehensive security audit skill for identifying dangerous APIs, footgun patterns, error-prone configurations, and hunting for vulnerability variants across codebases. Inspired by Trail of Bits' sharp-edges and variant-analysis methodologies.
VulnHunter combines two powerful security analysis techniques:
Activate this skill when:
Look for configurations that are insecure by default:
- CORS: Access-Control-Allow-Origin: *
- Debug modes enabled in production
- Default credentials or API keys
- Permissive file permissions (777, 666)
- SSL/TLS verification disabled
- Insecure deserialization settings
Memory Safety:
// Dangerous: No bounds checking
strcpy(), strcat(), sprintf(), gets()
memcpy() without size validation
// Safer alternatives
strncpy(), strncat(), snprintf(), fgets()
memcpy_s() with explicit size
Cryptography Footguns:
- ECB mode encryption
- MD5/SHA1 for security purposes
- Hardcoded IVs or salts
- Custom crypto implementations
- Random without CSPRNG (Math.random for tokens)
Concurrency Issues:
- Race conditions in file operations
- Time-of-check to time-of-use (TOCTOU)
- Double-checked locking anti-patterns
- Non-atomic increment/decrement operations
JavaScript/TypeScript:
// Dangerous patterns
eval(), new Function(), setTimeout(string)
innerHTML, outerHTML, document.write()
Object.assign() for deep clone (shallow only!)
== instead of === (type coercion)
Python:
# Dangerous patterns
pickle.loads(untrusted) # RCE vector
yaml.load(untrusted) # Use safe_load
exec(), eval()
os.system(), subprocess with shell=True
Rust:
// Patterns requiring extra scrutiny
unsafe { }
.unwrap() in production code
mem::transmute()
raw pointer dereference
Solidity/Smart Contracts:
// High-risk patterns
tx.origin for authentication // Phishing vulnerable
delegatecall to untrusted // Storage collision
selfdestruct // Permanent destruction
block.timestamp for randomness // Miner manipulable
When reviewing code, systematically check for:
Original bug: User input flows to SQL query without sanitization
Pattern: [user_input] -> [sink_function] without [validation_function]
Search for:
- Direct database calls with string concatenation
- ORM raw query methods with user parameters
- Similar data flows in adjacent modules
Original bug: Endpoint missing auth middleware
Pattern: Route definition without auth decorator/middleware
Search for:
- Routes defined after the vulnerable one
- Similar API patterns in other modules
- Admin/internal endpoints
Original bug: Check-then-act without atomicity
Pattern: if (check_condition()) { act_on_condition() }
Search for:
- File existence checks followed by file operations
- Permission checks followed by privileged actions
- Balance checks followed by transfers
# Find potential SQL injection
grep -rn "execute.*%s" --include="*.py"
grep -rn "query.*\+" --include="*.js"
# Find dangerous deserialize
grep -rn "pickle.loads\|yaml.load\|eval(" --include="*.py"
# Find command injection vectors
grep -rn "os.system\|subprocess.*shell=True" --include="*.py"
For more precise matching, use AST-based tools:
## Variant Analysis Report
### Original Finding
- **ID**: FINDING-001
- **Severity**: High
- **Root Cause**: [Description]
- **Affected File**: path/to/file.ext:line
### Pattern Extracted
[Code pattern or regex]
### Variants Discovered
| # | Location | Severity | Status | Notes |
|---|----------|----------|--------|-------|
| 1 | file.ext:42 | High | Confirmed | Same root cause |
| 2 | other.ext:100 | Medium | Suspected | Needs validation |
### Recommendations
[Systematic fix approach]
# Example: Detect SQL injection in Python
rules:
- id: sql-injection-format
patterns:
- pattern: $CURSOR.execute($QUERY % ...)
message: "Potential SQL injection via string formatting"
severity: ERROR
languages: [python]
// Find tainted data flowing to dangerous sinks
import python
import semmle.python.dataflow.TaintTracking
from DataFlow::PathNode source, DataFlow::PathNode sink
where TaintTracking::localTaint(source.getNode(), sink.getNode())
and sink.getNode().asExpr().(Call).getTarget().getName() = "execute"
select sink, source, sink, "Tainted input reaches SQL execution"
See the /examples folder for:
resources/sharp-edges-catalog.md - Comprehensive catalog of dangerous patternsresources/variant-patterns.md - Common vulnerability pattern templatestemplates/variant-report.md - Report template for variant analysisvulnhunter/
├── SKILL.md # This file
├── resources/
│ ├── sharp-edges-catalog.md # Categorized dangerous patterns
│ └── variant-patterns.md # Vulnerability pattern templates
├── examples/
│ ├── smart-contracts/ # Solidity/blockchain examples
│ ├── web-apps/ # Web application examples
│ └── native-code/ # C/C++/Rust examples
├── templates/
│ └── variant-report.md # Analysis report template
└── docs/
└── methodology.md # Detailed methodology guide
Weekly Installs
74
Repository
GitHub Stars
68
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex70
gemini-cli68
opencode67
github-copilot65
amp64
kimi-cli64
Lark Mail CLI 使用指南:邮件管理、安全规则与自动化工作流
37,000 周安装
Intercom自动化指南:通过Rube MCP与Composio实现客户支持对话管理
69 周安装
二进制初步分析指南:使用ReVa工具快速识别恶意软件与逆向工程
69 周安装
PrivateInvestigator 道德人员查找工具 | 公开数据调查、反向搜索与背景研究
69 周安装
TorchTitan:PyTorch原生分布式大语言模型预训练平台,支持4D并行与H100 GPU加速
69 周安装
screenshot 截图技能:跨平台桌面截图工具,支持macOS/Linux权限管理与多模式捕获
69 周安装
tmux进程管理最佳实践:交互式Shell初始化、会话命名与生命周期管理
69 周安装