FrancisVillalon/vulnerable-agentic-ai-app
GitHub: FrancisVillalon/vulnerable-agentic-ai-app
一个故意包含 prompt injection 和 agent 工具安全缺陷的 AI 简历优化靶机应用,用于网络安全实验中模拟和研究 Agentic AI 攻击向量。
Stars: 0 | Forks: 0
# CareerBoost — 存在漏洞的 Agentic AI 应用
一个故意设计存在漏洞的 AI 驱动的简历优化应用,旨在探索 **prompt injection** 和 **agentic AI 攻击向量**。
## 这是什么?
CareerBoost 模拟了一个真实世界的 agentic AI 服务,用户可以上传简历以获得 AI 驱动的优化。该应用程序在设计上包含了常见的 agentic AI 配置错误,用作研究和演示的靶机。
**包含的漏洞:**
- 直接 prompt injection
- 通过 agent 工具进行任意文件读取/写入
- 数据与指令之间没有隔离
## 技术栈
| 层级 | 技术 |
|---|---|
| 前端 | React + Vite (TypeScript) |
| 后端 | FastAPI (Python) |
| AI | 通过 `google-genai` 调用 Google Gemini 2.5 Flash Lite |
## 安装说明
**后端**
```
cd server
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload
```
**前端**
```
cd client
npm install
npm run dev
```
**环境** — 在根目录下创建一个 `.env` 文件:
```
GEMINI_API_KEY=your_key_here
ALLOWED_ORIGIN=your_allowed_origin_here
```
## 项目结构
```
├── client/ # React frontend
├── server/ # FastAPI backend
│ ├── agent.py # Gemini agent + tool definitions
│ ├── main.py # API routes
│ └── logger.py # Logging setup
├── examples/ # Sample resume files (including malicious payloads)
```
## 模型选择
| 模型 | 抵抗能力 | 备注 |
|---|---|---|
| `gemini-2.5-flash-lite` | 低 | 适合用于演示的良好攻击面 |
| `claude-haiku-4-5` | 高 | 能够主动识别并解释 injection 尝试 |
默认模型是 `gemini-2.5-flash-lite`。你可以更改为更高级的 gemini 版本进行测试。但是,使用其他提供商的模型需要修改代码。
## 攻击面
该 agent 拥有两个工具:`save_resume` 和 `read_resume`。两者都没有对文件名进行过滤,使其容易受到路径遍历的攻击。结合通过简历内容进行的 prompt injection,攻击者可以:
1. 读取任意文件(`/etc/passwd`、`/proc/self/environ`)
2. 写入任意文件
3. 如果进程以特权用户身份运行,则可实现持久化
标签:逆向工具