Repository navigation
Description
Severity: medium-high — attack-surface review of the paid delivery path. Sibling finding: the inflated-total_bytes billing gap (filed separately); both trace to the same root — bytes are proven once, at an edge, always after money moves.
The gap
BLAKE3 verification is exclusively receiver-side and admission-time-only:
- Pull-through and peer-fill admissions verify before commit (
encode_verified_range,admit_bao_stream) — correct, and the last time the node hashes anything it holds. - Every serve leg reads store bytes plus the stored outboard verbatim:
export_bao_range_stream(crates/cache/src/engine.rs:4096) re-emits what is on disk, andoutboard_pairs(engine.rs:4197) exports proof nodes with "NO re-hashing". - There is no scrub / bitrot / integrity pass anywhere in the cache engine.
rescan_originsprobes origin existence and size only. serve_audit(engine.rs:2087) answers presence + size + gates; it does not touch hashes.has_blobmeans "root-verified at admission" (ADR 022), so discovery keeps routing buyers to a node whose stored bytes diverged after the fact.
Nothing distinguishes a malicious operator tampering with its own store from honest disk rot. In both cases the blob stays fully serveable and metered until manual eviction/GC.
Attack (deliberate case)
An operator legitimately pulls and admits blob H (passes verification, earns honest paid serves). It then corrupts the stored bytes at rest and keeps serving:
- Serve legs emit the corrupted bytes with internally-consistent-looking bao framing drawn from the stale outboard — BLAKE3 preimage resistance guarantees every receiver ends at typed
HashMismatch(crates/client-pull/src/lib.rs:2116,sink.rs:154), so content poisoning is impossible. What remains is billing. - Vouchers/reveals are released per delivered chunk as bytes arrive (
receive_and_pay, client-pull/src/lib.rs:2352) — payment precedes verification by construction. Revealed amounts are irreversible; the 48–72 h dispute window (PaymentPool.sol:69) adjudicates watermarks and rate evidence, not content quality. - Reputation is local-only EWMA (ADR 008): each new victim independently rediscovers the bad node and pays for the discovery again. A fetch gives the offender at most
MAX_PROVIDER_ATTEMPTS = 3(crates/node/src/selection.rs:18) fully-billed corrupt attempts.
This is a pure pay-for-garbage vector: identical settlement dynamics to the sibling billing finding, minus the inflation lever. Bytes billed per victim equal the genuine blob size (wire ≈ content × 1.002).
Impact
| Lever | Value |
|---|---|
| Persistence | Until eviction/GC — no detection mechanism exists in-node |
| Per-victim cost | Full blob-size bill at the quoted rate, repeated across all comers |
| Attacker revenue | Honest-rate payment for undelivered service — profit = zero-quality-service revenue, not free money |
Not a duplicate
#853 / #837 / #835 cover wrong-hash admissions at the pull-through edge and their eviction side effects. This finding covers at-rest divergence after a correct admission, where none of today's machinery looks again.
Refs: #853, ADR 038 §Payment metering, ADR 008.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity
thiras commentedon Sep 10, 2026
Recommendation
Keep the primary defense where it is — receiver-side verification + local scoring (typed
HashMismatch→Corruption, wired throughis_bao_corruption) — and add only what the trustless axiom permits:rescan_origins. Re-verify K random held blobs per pass; evict on mismatch. This is hygiene, not the attack fix: an attacker patches it out. It earns its place because honest bitrot today presents identically to the attack, and both deserve eviction.Corruptionlabel with offending operator id + last-seen so it survives restarts. NodeIds are handshake-bound and staked, so rotation isn't free — but adopt only if measurement shows the EWMA recovery horizon lets a corrupted node re-win candidates too cheaply.StreamResponse{ok:true}plus one delivered chunk group with its bao sibling path, checked againstHby a small on-chain evaluator — binds the benefit-taker). Contract surface for new machinery; build only if the tests below show material loss.Tests to write
HashMismatch, provider scoresCorruption, ≤MAX_PROVIDER_ATTEMPTSpayments reach the offender per fetch.Shared-root note with the sibling finding: neither issue introduces a new untrusted input; both shrink to noise once the distance between "money moved" and "byte proven" collapses to one chunk group everywhere.
yigitdot commentedon Sep 11, 2026
Verification against main (
8b437de5)Partially valid — the headline is overstated.
Holds:
crates/cache.rescan_originsprobes origin existence + size only;serve_auditchecks presence + size + gates;has_blobmeans root-verified at admission (ADR 022).evicts it (ADR 040 namesCacheEngine::evictas the corruption-recovery path).Does not hold — serve legs do not emit unverified bytes:
export_bao_range_stream/outboard_pairsdo no hashing at the decdn layer, but the iroh-blobs call beneath them does. iroh-blobs 0.103.0export_bao_impl(src/store/fs.rs:1213) runs bao-treetraverse_ranges_validated, which re-derives every parent CV from the outboard against the root and re-hashes every leaf (LeafHashMismatch/ParentHashMismatch) before emitting the item. A mismatch surfaces as a mid-streamErr(engine.rs:4171-4176) and the node aborts withoutStreamEnd(delivery.rs:129-141).encode_ranges_validated(serve_encoder.rs:339), same guarantee.engine.get/export_range(irohexport_ranges), whose callers are admin/metrics, not the paid serve.So a corrupt-at-rest group aborts the serve at that group; the client pays only for the valid prefix it received. "Pay-for-garbage until eviction" does not happen. The real cost is a failed delivery (wasted buyer bandwidth + a local
Corruptionreputation hit), not honest-rate payment for garbage.Suggested rescope: retitle to "cache: no post-admission scrub; rotten blobs stay advertised until a serve trips" and downgrade to low/medium. Item 1 of the recommendation (sampled re-hash in
rescan_origins, evict on mismatch) is still the right hygiene fix; items 2–3 lose their motivation.Docs bugs surfaced by this check (worth a separate PR):
engine.rs:4069,4197describe the decdn layer only and are false end-to-end.fix(cache): keep a quarantined hash out of the fill path and self-hea…
fix(cache): quarantine a held blob when its serve trips a stored hash…