Purifier
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Purifier - 原型链污染审计 MCP 服务器
Purifier 是一个专注于原型链污染漏洞审计的 MCP工具。它通过识别 Sources、Sinks、Gadgets 和 Pollution Patterns 来分析 JavaScript/TypeScript 项目中的原型链污染风险。
特性
四类检测模式:Sources(污染源)、Sinks(传播点)、Gadgets(利用点)、Pollution(显式污染)
攻击链分析:自动分析 Sources → Sinks → Gadgets 的关联性
严重性评级:CRITICAL、HIGH、MEDIUM、LOW、INFO 五级分类
并行扫描:支持多线程并行扫描大型项目
配置灵活:YAML 配置文件和环境变量支持
Related MCP server: audit-mcp-cli
漏洞检测类别
类别 | 描述 | 示例模式 |
Sources | 用户输入入口点 |
|
Sinks | 危险的合并/赋值操作 |
|
Gadgets | 原型链利用的小工具 |
|
Pollution | 显式的原型操作 |
|
安装
pip install -r requirements.txt使用
运行服务器
python server.py与 Claude Desktop 集成
{
"mcpServers": {
"purifier": {
"command": "python",
"args": ["D:\\project\\Purifier\\server.py"]
}
}
}工具说明
核心工具
工具 | 描述 |
| 完整原型链污染审计 + 攻击链分析 |
| 专门分析攻击链(Sources→Sinks→Gadgets) |
| 按类别扫描(source/sink/gadget/pollution) |
| 按严重性过滤 |
| 列出可扫描文件 |
| 读取代码上下文 |
兼容性工具
工具 | 描述 |
| 扫描用户输入入口点 |
| 扫描危险合并函数 |
| 扫描显式污染模式 |
| 扫描可利用的小工具 |
配置
在项目根目录创建 config.yaml:
# 文件扩展名
extensions:
- .js
- .ts
- .jsx
- .tsx
# 排除目录
exclude_dirs:
- node_modules
- vendor
- dist
- build
# 排除文件
exclude_files:
- "*.min.js"
- "*.bundle.js"
# 最大文件大小(字节)
max_file_size: 1048576
# 并行扫描
parallel: true
max_workers: 4
# 启用/禁用类别
enabled_categories:
source: true # 用户输入
sink: true # 危险操作
gadget: true # 利用点
pollution: true # 显式污染
# 日志级别
log_level: WARNING
# 输出格式(markdown、json)
output_format: markdown环境变量
变量 | 描述 |
| 最大文件大小 |
| 并行工作线程数 |
| 是否启用并行扫描 |
| 日志级别 |
攻击链分析
Purifier 会自动分析潜在的原型链污染攻击链:
用户输入 (SOURCE)
↓
危险的合并操作 (SINK)
↓
原型被污染
↓
可利用的小工具 (GADGET)
↓
远程代码执行 (RCE)风险评级
🚨 CRITICAL: 完整的攻击链存在(Source + Sink + Gadget)
⚠️ HIGH: 原型污染可能(Source + Sink)或显式污染
ℹ️ MEDIUM: 只发现 Sink,需验证输入清理
✅ LOW: 无明显风险
常见漏洞示例
Lodash.merge 污染
// 危险:用户输入直接传入 merge
const _ = require('lodash');
app.post('/merge', (req, res) => {
const merged = _.merge({}, req.body); // 原型链污染!
res.json(merged);
});Object.assign 污染
// 危险:目标为空对象时
app.post('/assign', (req, res) => {
const config = Object.assign({}, req.body); // 可能污染!
res.json(config);
});EJS RCE via 原型污染
// 如果原型被污染,EJS 可导致 RCE
const ejs = require('ejs');
// 污染: Object.prototype.outputFunctionName = "_tmp1;global.process.mainModule.require('child_process').exec('calc');//"
app.post('/render', (req, res) => {
ejs.render('template', req.body); // RCE!
});测试
# 安装开发依赖
pip install -r requirements-dev.txt
# 运行测试
pytest tests/
# 带覆盖率报告
pytest tests/ --cov=purifier项目结构
Purifier/
├── purifier/
│ ├── __init__.py # 包导出
│ ├── models.py # 数据模型
│ ├── patterns.py # 检测模式(原型链污染专用)
│ ├── scanner.py # 核心扫描器
│ └── config.py # 配置管理
├── tests/
│ ├── __init__.py
│ └── test_scanner.py # 单元测试
├── server.py # MCP 服务器
├── config.yaml # 配置文件
├── requirements.txt # 依赖
├── CLAUDE.md # Claude Code 指南
└── README.md # 本文件Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Audit GitHub repos for malicious and supply-chain code before you depend on them.
Static MCP server scan: injection, secrets, tool poisoning. SARIF + rules catalog.
Related MCP Servers
- AlicenseCqualityDmaintenanceAudits npm package dependencies for security vulnerabilities, providing detailed reports and fix recommendations with MCP integration.134 npm58MIT
- AlicenseAqualityDmaintenanceLightweight Node.js dependency vulnerability audit tool with CLI and MCP Server modes. Supports npm/pnpm, full dependency chain tracing, remote GitHub repo auditing, and generates Markdown/HTML reports.112 npm1MIT
- AlicenseNot gradedqualityCmaintenanceZero-execution static AST security scanner and vulnerability auditor for MCP servers. Detects Command Injection (CWE-78), Path Traversal (CWE-22), Hardcoded Secrets (CWE-798), and Unauthenticated Transports (CWE-306).MIT
- AlicenseNot gradedqualityAmaintenanceEnables users to audit npm, Yarn, and pnpm lockfiles in local projects or remote Git repositories through MCP, with configurable vulnerability thresholds, dev-dependency skipping, retry counts, and text or JSON reports.13 npmMIT