Slither triage
Static analysis floods you with findings; the job is not to run it but to separate exploitable true positives from known-benign noise and prove each one.
Procedure
- Install and run:
slither . --config-file slither.config.json
slither . --print human-summary
- Use a config that fails the build only on chosen detectors:
{ "detectors_to_exclude": "naming-convention,solc-version,pragma,assembly", "exclude_informational": false, "exclude_low": false }
- Triage by severity and reachability:
reentrancy-eth, arbitrary-send-erc20, delegatecall-loop, controlled-delegatecall, unprotected-upgrade, tx-origin, unchecked-transfer, incorrect-equality.
- For each finding, click to the source line and decide: is the path reachable by an unauthorised caller with attacker input?
- Suppress a confirmed-benign finding with an inline comment, which the tool respects:
// slither-disable-next-line reentrancy-events
emit Refunded(user, amount);
- Re-run and confirm it disappears:
slither . 2>&1 | grep -c "reentrancy-events" returns 0.
- For each true positive, write a minimal Foundry test that triggers it — a Slither finding without a PoC is a hypothesis.
- Cross-check with a second analyser (
aderyn or mythril) so a detector-specific false negative is caught.
- Run
slither . --print inheritance-graph to reason about which contract actually owns the flagged function.
- Record: detector, severity, source line, reachability, verdict, and PoC test name.
Pitfalls
reentrancy-eth fires on every .call{value:} even with a nonReentrant guard; check the guard before chasing it.
unchecked-transfer false-positives on SafeERC20 unless the library path is followed; confirm the return is checked.
tx-origin in a test harness is benign; in a funded contract it is the classic phish.
- Excluding
assembly wholesale hides real storage bugs; exclude it only per finding.
- Treating informational findings (naming) as zero-value misses the signal that a function name contradicts its behaviour.
Verification
slither . --config-file slither.config.json > slither.txt 2>&1; grep -cE "^(INFO|LOW|MEDIUM|HIGH)" slither.txt
Pass: every HIGH/MEDIUM is either annotated with slither-disable-next-line and justified, or has a linked PoC test.
Report the detector counts, the true positives with PoC names, and the suppressed lines.
1---2name: slither-triage3description: Use when slither produces detector findings and you must decide which are real. Runs the tool, filters noise detectors, and writes a minimised Foundry PoC for each true positive.4metadata:5 source: https://skillmd.com/skills/jiayaoqijia/slither-triage6---78# Slither triage910Static analysis floods you with findings; the job is not to run it but to separate exploitable true positives from known-benign noise and prove each one.1112## Procedure13141. Install and run:1516```17slither . --config-file slither.config.json18slither . --print human-summary19```20212. Use a config that fails the build only on chosen detectors:2223```json24{ "detectors_to_exclude": "naming-convention,solc-version,pragma,assembly", "exclude_informational": false, "exclude_low": false }25```26273. Triage by severity and reachability: `reentrancy-eth`, `arbitrary-send-erc20`, `delegatecall-loop`, `controlled-delegatecall`, `unprotected-upgrade`, `tx-origin`, `unchecked-transfer`, `incorrect-equality`.284. For each finding, click to the source line and decide: is the path reachable by an unauthorised caller with attacker input?295. Suppress a confirmed-benign finding with an inline comment, which the tool respects:3031```solidity32// slither-disable-next-line reentrancy-events33emit Refunded(user, amount);34```35366. Re-run and confirm it disappears: `slither . 2>&1 | grep -c "reentrancy-events"` returns 0.377. For each true positive, write a minimal Foundry test that triggers it — a Slither finding without a PoC is a hypothesis.388. Cross-check with a second analyser (`aderyn` or `mythril`) so a detector-specific false negative is caught.399. Run `slither . --print inheritance-graph` to reason about which contract actually owns the flagged function.4010. Record: detector, severity, source line, reachability, verdict, and PoC test name.4142## Pitfalls4344- `reentrancy-eth` fires on every `.call{value:}` even with a `nonReentrant` guard; check the guard before chasing it.45- `unchecked-transfer` false-positives on `SafeERC20` unless the library path is followed; confirm the return is checked.46- `tx-origin` in a test harness is benign; in a funded contract it is the classic phish.47- Excluding `assembly` wholesale hides real storage bugs; exclude it only per finding.48- Treating informational findings (naming) as zero-value misses the signal that a function name contradicts its behaviour.4950## Verification5152 slither . --config-file slither.config.json > slither.txt 2>&1; grep -cE "^(INFO|LOW|MEDIUM|HIGH)" slither.txt5354Pass: every HIGH/MEDIUM is either annotated with `slither-disable-next-line` and justified, or has a linked PoC test.5556Report the detector counts, the true positives with PoC names, and the suppressed lines.