一条命令即可判定所报告的漏洞在给定源码树中是否实际可达。
向它提供 CVE 描述,或一整份漏洞扫描报告,它便会在你的代码上运行由 LLM 驱动的可达性分析,然后写出结构化判定结果、Markdown 报告,以及 GitHub 代码扫描可读取的 SARIF。
为控制成本,该 agent 不会将你的仓库读入模型上下文。 它改为通过一套工具集来工作:用 ast-grep 进行结构化代码导航, 通过 OSV.dev 查询和页面渲染来获取安全公告与修复提交; 当受影响组件是构建产物而非随仓库附带时,通过依赖获取将固定版本的上游代码带入沙箱。
该 action 通过工作流内置的 GITHUB_TOKEN 在 GitHub Copilot 上运行。授予 copilot-requests: write 权限后便无需其他配置。OWASP Xpsd 的用量会与你的其他 Copilot 支出一起计入组织账单。
permissions:
contents: read
security-events: write
copilot-requests: write # the built-in token authenticates Copilot
如果你更愿意使用自己的模型,provider-type 和 api-key 可以将运行切换到 Anthropic、OpenAI 或 Azure,而无需更改其他任何内容。
name: reachability
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * 1"
permissions:
contents: read
security-events: write
copilot-requests: write
jobs:
reachability:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: anchore/sbom-action@v0
with: {format: cyclonedx-json, output-file: sbom.cdx.json, upload-artifact: false}
- uses: anchore/scan-action@v6
with: {sbom: sbom.cdx.json, output-format: json, output-file: scan.json, fail-build: false}
- uses: byteray-ai/xpsd@v1
id: xpsd
with:
scan-file: scan.json
model: gpt-5.3-codex
min-severity: high
max-findings: "10" # cap the analyzed findings, highest severity first
# min-cvss: "7.0" # numeric floor instead of the severity band
# is-remote: "true" # only findings shown to be network-reachable (AV:N)
# is-exploited: "true" # only findings CVSS-BT lists as exploited
# max-cycles: "30" # tool-call budget per finding
# max-tokens: "150000" # token budget per finding; first ceiling hit wins
# fail-on: reachable # fail the step when something is reachable
- uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: ${{ steps.xpsd.outputs.sarif-file }}
category: xpsd-reachability
将扫描器替换为你已经在运行的任意一个。OWASP Xpsd 会自动检测报告格式:
| 生成工具 | 格式 |
|---|---|
| Grype | grype -o json,或 SARIF |
| Trivy | trivy -f json,或 SARIF |
| OSV-Scanner | --format json |
| Snyk | snyk test --json,单个项目或 --all-projects |
| 任意 SARIF 生成工具 | SARIF 2.1.0 |
| 判定结果 | 告警 | 严重级别 |
|---|---|---|
| 可达(中/高置信度) | error | 来自 CVSS |
| 可达(低置信度)、不确定、分析失败 | warning,需要人工复核 | 来自 CVSS |
| 不可达 | note,信息性 | 降为 low |
被排除的发现会以 low 级别归档,而不是保留其 CVSS 评级,因为该评分描述的是漏洞本身,而非它对代码构成的风险。一个无人能触及的严重漏洞,恰恰会掩盖那个真正能被触及的漏洞。真实评分仍保留在告警中,同时附有推理过程和证据。
每个告警都包含模型的推理依据、从入口点到易受攻击使用点的调用路径,以及指向相关源代码行的证据链接。重新运行会就地刷新相同的告警,而在后续上传中消失的发现会自动关闭。
成本按每个发现计算,每个发现对应一次 agentic 会话,因此过滤是控制运行规模的方式:min-severity、min-cvss、max-findings 和 only 用于选择要查看的内容,而 is-remote 仅保留被证明可网络访问的发现(CVSS AV:N),is-exploited 仅保留 CVSS-BT 数据集列为已被利用的发现。两者都需要正面证据,因此它们无法确认的发现会被丢弃。当你希望为构建设置门禁时,fail-on 会将可达判定转变为失败的步骤。
可达性还取决于代码之外的事实,例如实际被编译的内容或暴露到网络的内容。guidance 输入会将这些事实作为分析的基准事实传入。
欢迎提交缺陷报告和拉取请求;请参阅 CONTRIBUTING.md。请按照 SECURITY.md 中所述私下报告漏洞,该文件还记录了威胁模型和已知限制。
Apache License 2.0,请参阅 LICENSE。Copyright 2026 ByteRay Ltd.