Releases: augusttw/v4-hooks-analyzer
Releases · augusttw/v4-hooks-analyzer
Release list
v0.3.1
Fix of the v0.3 review findings:
- No silent callback drop — PUSH4-found selectors without a PUSH2 dispatcher entry now fall back to a labeled whole-contract scan ("isolation unverified") instead of being discarded
- No segment truncation — extract_callback_segment no longer cuts a handler at an internal REVERT/INVALID branch-exit followed by real code
- Clippy-clean — all cargo clippy -D warnings errors fixed
- +4 regression tests (7 total)
v0.3.0 — Per-Callback Bytecode Isolation
v0.3.0
What's New
- Per-callback bytecode isolation: risk analysis now runs on each callback's own isolated code path — from its dispatcher JUMPDEST to its terminator — instead of scanning the whole contract. Eliminates false positives where one callback's SSTORE/CALL flagged unrelated callbacks.
- Real dispatcher jumpdest capture: the dispatcher parser now understands
PUSH4 selector → EQ → PUSH2 dest → JUMPIand records the actual handler entry PC (previously hardcoded to 0, which made isolation impossible). - Unit tests for dispatcher parsing and segment isolation on synthetic bytecode.
Fixes
- Fixed index-vs-PC confusion in segment extraction (bytecode PCs were being used as instruction indices).
- Fixed premature segment termination on internal JUMPDESTs (conditional branches no longer cut analysis short).
Notes
- Static analysis remains point-in-time only. Upgradeable hooks (EIP-1967) can change implementation between scan and interaction.
v0.2.0 — Bytecode Selector Matching & EIP-1967 Proxy Detection
v0.2.0
What's New
- Bytecode selector matching: detects callbacks via 14 real keccak256 selectors in bytecode dispatchers, not just address flags
- EIP-1967 proxy detection: identifies upgradeable implementation slots (0x360894...) and admin slots (0xb531276...) loaded via SLOAD + DELEGATECALL — flagged as a point-in-time verdict that cannot be cached
- Dual detection display: shows address-flag-detected callbacks AND bytecode-detected callbacks separately in the report
- Address parsing fix: V4 hook addresses (40 hex chars) now correctly extract the lower 14 bits — previously u64 overflow caused all flags to read as zero
Risk Heuristics (unchanged from v0.1)
- SELFDESTRUCT → critical
- DELEGATECALL / proxy behavior → critical
- Reentrancy (SSTORE after CALL) → high
- External calls during swap/donate → high
- TIMESTAMP/NUMBER dependency (MEV vector) → medium
- Delta capability warnings → info
User-Requested Improvements
- Clear disclaimer that address flags indicate permitted callbacks only, not what the code actually does
- Static analysis caveat: hooks with runtime-only malicious paths (block N threshold, balance check) may appear clean
- Proxy explanation: upgradeable hook verdicts are point-in-time only — implementation can change between scan and interaction
Bug Fixes
- Fixed u64 overflow in address flag parsing (address was 40 hex chars, u64 could only hold 16)
- Added proper
fetch_bytecode()function viaeth_getCodeRPC call - Added
selectorfield toHookCallbackstruct andbuild_selector_map() - Removed unused
tiny-keccakdependency (used only for selector generation)
Chore
- Bumped version to 0.2.0
- Updated README with accurate feature list and roadmap