# Slither 有High告警或空结果：核对运行、规则范围与源码位置

整理：链小知（AI 辅助）
资料核对日期：2026-10-12
引用地址：https://lianxiaozhi.com/tools/guides/slither-saved-detector-json-scope-triage
难度：进阶
核验方式：官方文档整理，未执行真实账户操作

从本人已有JSON和日志解读impact/confidence、过滤及编译版本，整理人工排错依据，不把运行成功或零结果当安全审计。

## 使用工具
- [Slither](https://lianxiaozhi.com/tools/slither) · [官方入口](https://github.com/crytic/slither)

## 前置条件
- 准备本人项目同一commit的已保存JSON、运行日志、原命令/配置、Slither及compiler版本和对应源码；不安装/运行工具。
- 字段依据0.11.6固定tag与官方JSON文档；旧报告或自定义detector可能不同。

## 1. 先确认报告版本和文件确为本轮输出

记录项目commit/源码快照、目标路径、Slither版本、crytic-compile/framework和实际compiler版本。0.11.6 README要求Python3.10+并依赖编译framework/solc，pragma范围不能证明原运行用了哪个solc。

固定版本output_to_json遇已有文件会阻止覆写；核文件时间、日志“overwrite is prevented”与原命令，避免把旧报告当新扫描。没有原日志/版本时保留报告来源待核，而不重新安装或触发构建。

核对结果：报告与原运行/目标/版本可配对，旧文件或编译版本缺口明确。
依据：[Slither 0.11.6 产品与安装边界](https://raw.githubusercontent.com/crytic/slither/0.11.6/README.md)
依据：[Slither 0.11.6 官方发布说明](https://github.com/crytic/slither/releases/tag/0.11.6)
依据：[Slither 0.11.6 JSON envelope与输出文件](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/utils/output.py)

## 2. 拆开JSON输出成功与CI退出原因

顶层success=true/error=null表示输出没有运行错误，不表示detectors无告警。success=false保留error及相关日志，compile/parsing失败不能计为扫描安全通过。

0.11.6 CLI按fail_on等级可因有效告警非零退出；因此非零退出与JSON success=true可同时成立。核原fail_on和实际告警impact，不把CI失败统一当编译错误，也不从退出0证明无全部问题。

核对结果：运行错误、告警导致退出与正常输出三种状态分开。
依据：[Slither 0.11.6 JSON envelope与输出文件](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/utils/output.py)
依据：[Slither 0.11.6 CLI 执行/导出分支](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/__main__.py)
依据：[Slither 官方JSON字段文档](https://github.com/crytic/slither/wiki/JSON-output)

## 3. 判断detectors缺项究竟意味着什么

查看results.detectors是否取得及原--json-types。固定代码仅有结果且选detectors类型时才写该键；缺key不能直接等同[]，results.printers也不是同一种分析。

若原命令有--print，0.11.6 _process走run_printers而不run_detectors，导图成功不是同一轮完成漏洞扫描。日志No contract was analyzed、目标/编译失败或不完整日志都记录未覆盖，不生成虚假的零告警统计。

核对结果：结果类型、扫描模式和分析合约范围有原依据，缺项没有被填成零。
依据：[Slither 0.11.6 CLI 执行/导出分支](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/__main__.py)
依据：[Slither 0.11.6 配置与抑制规则](https://raw.githubusercontent.com/crytic/slither/0.11.6/docs/src/Usage.md)

## 4. 按check、impact与confidence列人工核验优先级

每条记录保留check、impact、confidence、description及存在的reference/id。impact是影响等级，confidence是检测置信等级，两者不合并成概率或资金损失金额；reference旧版本可缺，不能补成已读规则。

例如当前官方reentrancy-eth页写High/Medium且不覆盖无ETH重入；具体规则按原报告版本/check核。High不是已成功攻击，Low也不是无需复核，必须对原源码、调用和权限条件进行人工判断。

核对结果：每条告警有自身规则及两个等级，结论保持候选问题而非已利用漏洞。
依据：[Slither 0.11.6 detector输出与适用条件](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/detectors/abstract_detector.py)
依据：[Slither 官方JSON字段文档](https://github.com/crytic/slither/wiki/JSON-output)
依据：[Slither 官方Detector规则文档](https://github.com/crytic/slither/wiki/Detector-Documentation)

## 5. 用原源码位置核对告警上下文

从elements逐项找type/name、source_mapping.filename_relative或原路径及lines，配对同commit源码。lines从1起；start/length按字节不是行号，含多字节字符时不能用普通字符下标直接切原源码。

查看elements关联的函数/变量和实际权限、外部调用、状态更新条件。没有源码、位置缺失或项目版本不同就列待核；误报判断应有具体反证，不能只因开发者声称有modifier就删除告警。

核对结果：每条结论绑定原文件/行与具体上下文，缺位置或反证明确。
依据：[Slither 官方JSON字段文档](https://github.com/crytic/slither/wiki/JSON-output)
依据：[Slither 0.11.6 JSON envelope与输出文件](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/utils/output.py)
依据：[Slither 0.11.6 detector输出与适用条件](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/detectors/abstract_detector.py)

## 6. 检查抑制规则并保留未覆盖项

核--detect/--exclude、等级排除、filter/include paths、依赖/assembly配置、disable注释以及triage数据库slither.db.json；CLI优先config，0.11.6也接受slither.conf.json。隐藏条目不代表已修复。

部分detector按VULNERABLE_SOLC_VERSIONS或LANGUAGE可不适用，再经valid_result过滤/去重。输出人工待核、已据上下文反证、历史抑制与未扫描范围清单；没有实际重跑就不写修复验证或审计通过。

核对结果：告警结论、抑制来源与扫描缺口都可追溯，没有安全保证。
依据：[Slither 0.11.6 配置与抑制规则](https://raw.githubusercontent.com/crytic/slither/0.11.6/docs/src/Usage.md)
依据：[Slither 0.11.6 detector输出与适用条件](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/detectors/abstract_detector.py)
依据：[Slither 0.11.6 CLI 执行/导出分支](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/__main__.py)

## 常见错误
- success=true与退出0都是运行/配置层信号，不能当合约安全证书。
- 缺detectors键、printer-only或隐藏结果不等全规则零告警。
- impact/confidence不同；旧报告与当前源码错配会让源码位置与误报判断失真。

## 完成检查
- 整理原版本/运行状态/扫描范围和逐告警源码核验表，保留抑制与证据缺口。
- 没有运行Slither、编译器或真实攻击/链上操作；所有判断为documentation边界。

## 相关知识
- [合约代码已验证，为什么仍不能直接判断安全？](https://lianxiaozhi.com/learn/verified-contract-boundaries)
- [原始、解码和整理后的链上数据有什么区别？](https://lianxiaozhi.com/learn/raw-decoded-curated-data)
- [把数据上链，与只保存数据哈希有什么区别？](https://lianxiaozhi.com/learn/data-onchain-vs-offchain)

## 官方依据
- [Slither 0.11.6 产品与安装边界](https://raw.githubusercontent.com/crytic/slither/0.11.6/README.md)
- [Slither 0.11.6 官方发布说明](https://github.com/crytic/slither/releases/tag/0.11.6)
- [Slither 0.11.6 JSON envelope与输出文件](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/utils/output.py)
- [Slither 0.11.6 CLI 执行/导出分支](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/__main__.py)
- [Slither 官方JSON字段文档](https://github.com/crytic/slither/wiki/JSON-output)
- [Slither 0.11.6 配置与抑制规则](https://raw.githubusercontent.com/crytic/slither/0.11.6/docs/src/Usage.md)
- [Slither 0.11.6 detector输出与适用条件](https://raw.githubusercontent.com/crytic/slither/0.11.6/slither/detectors/abstract_detector.py)
- [Slither 官方Detector规则文档](https://github.com/crytic/slither/wiki/Detector-Documentation)
