# Strix 代码漏洞查找 (find-security-vulnerabilities-in-code)

> 用 Strix 做白盒安全审查：读源码梳理数据流和授权，再在沙箱中尝试利用并附 PoC。

- 分类: [安全审计](https://www.myskills.tools/zh/categories/security-audit/)
- 来源: 官方 · Strix
- 代码仓库: https://github.com/usestrix/strix/tree/main/skills/find-security-vulnerabilities-in-code (commit 42baa7c)
- SKILL.md: https://github.com/usestrix/strix/blob/main/skills/find-security-vulnerabilities-in-code/SKILL.md
- 安装命令: `npx skills add usestrix/strix --skill find-security-vulnerabilities-in-code`
- 许可证: Apache-2.0
- 兼容工具: Claude Code, Codex, Cursor
- 权限: read-repo ✓, write-files ✓, shell ✓, network ✓
- 状态: 扫描通过
- 规则扫描无法覆盖所有风险，安装前请阅读此技能的 SKILL.md，确认权限后再使用。
- ⚠ 需要 Strix CLI，以及 Docker 加 LLM 密钥，或登录 Strix 云服务；运行会产生模型调用费用。

## 核心规则

报告前逐条确认 PoC 确实体现影响；退出码 0 只表示未证明可利用，不代表代码安全。

## 执行阶段

1. **限定范围** — 指向高风险子目录或只审分支 diff，并说明租户模型、信任边界和攻击者可控的输入。
2. **运行 Strix** — 对本地目录或 GitHub 仓库运行 strix，用 --max-budget 控制成本；有运行中的实例时一并作为目标以验证可利用性。
3. **阅读结果** — 从 penetration_test_report.md 开始，逐个打开 vulnerabilities/ 下的发现，核对 PoC、文件与行号。
4. **修复并复测** — 交给配套的修复技能修根因，再重跑 Strix 确认利用已失效；依赖扫描和密钥扫描仍需保留。

## 权限说明（据 SKILL.md 整理）

| 能力 | 是否需要 | 说明 |
|---|---|---|
| 文件写入 | 部分需要 | 本地路径以可写方式挂载进沙箱，代理可能改动它，应在干净的检出上运行；结果写入 strix_runs/。 |
| 命令执行 | 部分需要 | 运行 Strix CLI，由其在 Docker 沙箱中执行代理和利用尝试。 |
| 网络外发 | 部分需要 | 调用所配置的 LLM 提供方，访问指定的仓库或应用目标；云模式下使用 Strix 托管平台。 |

## SKILL.md 头部信息（YAML）

```yaml
---
name: find-security-vulnerabilities-in-code
description: Find security vulnerabilities in a codebase or repository with Strix — a white-box AI security review that reads your source, reasons about the actual data flow and authorization model, then exploits what it finds in a live sandbox so every reported issue has a working proof-of-concept instead of a noisy static-analysis alert. Covers injection, XSS, SSRF, broken access control and IDOR, insecure deserialization, secrets in code, unsafe dependencies, and business-logic flaws. Use when the user asks to security-scan, security-review, or audit their code, repo, or pull request for vulnerabilities.
license: Apache-2.0
metadata:
  author: usestrix
  homepage: https://docs.strix.ai
---
```

首页: https://www.myskills.tools/zh/ · URL: https://www.myskills.tools/zh/skills/find-security-vulnerabilities-in-code/
