Skip to content

security review at b5e29ae: low-severity hardening items #2851

Todo

Description

@altanoruc

Source: security review at b5e29ae (2026-11-05). Each claim below was re-read on disk by independent verifiers.

Each item was verified against the code at b5e29ae. None of them is covered by an existing issue that I could find. Split any item into its own issue when someone picks it up.

  • Voucher rate tolerance. crates/incentive/src/rate.rs:33: DEFAULT_TOLERANCE_BPS = 100 is justified as rounding slack for the client, but the client prices with div_ceil (crates/client/src/ledger.rs:102-105), so an honest payer never needs it. A payer can underpay 1% of every span. A rollover can move about 2.58 MiB per 255-chunk chain into the watermark at no extra amount (scratch test). There is no config knob. Set it to 0, or add a config field defaulting to 0, and update ADR 003:817.
  • config init file mode. crates/cli/src/commands/config.rs:575: decdn config init writes node.toml with fs::write (0644) and creates the parent directory 0755. The file is the documented home of a provider rpc_url. Open it with mode 0600 and create the parent 0700.
  • Gateway known-signer budget. crates/cli/src/commands/gateway.rs:997-1002, :1549: the known-signer lookup budget is per namespace. A former owner's key, still in high_water, can spend the 10/min budget and leave the current owner's PUT /_pointer answered 429 (scratch test). Key the budget per (namespace, signer).
  • Onramp overflow window. crates/sponsord-onramp/src/net.rs:79, :88: past MAX_TRACKED distinct clients, all further clients share one overflow window. Enough distinct sources make every untracked client get 429 on /v1/capability and /v1/fund. Hash untracked clients into a fixed array of overflow windows.
  • Onramp without ConnectInfo. crates/sponsord-onramp/src/net.rs:124, docs/sponsord/integrator.md:99: rate limits and Turnstile remoteip are skipped when the peer address is unknown, and the integrator doc tells embedders to serve http::router(state) without ConnectInfo. Fix the doc to use into_make_service_with_connect_info::<SocketAddr>(), and warn at startup when neither ConnectInfo nor ONRAMP_CLIENT_IP_HEADER is configured.
  • Attestation verifier ignores registration status. crates/node/src/dht/attestation.rs:73: admits checks only "seated and not deny-listed". OriginAssignment seats persist after an operator leaves until someone calls pruneInactiveOrigin. Require the signer's NodeId to be in the node's current registered set.
  • Attestation persisted before the pull lands. crates/node/src/node_origin/pull_leg.rs:1006, node_origin/mod.rs:2552, node_origin/timed_source.rs:86: an upstream-offered attestation is written under <data_dir>/attestations at the handshake and reloaded on every boot, even if no byte ever verifies. Persist it on commit, or sweep attestations for hashes the cache does not hold.
  • Reserved pull-state paths are case-sensitive. crates/client/src/bundle/engine.rs:461-481, :327, :407: .decdn-partial, .decdn-manifest.json and .decdn-bundles are compared byte for byte. On APFS or NTFS, a manifest entry such as .DECDN-PARTIAL/<hex> lands in the staging directory or on the manifest cache (scratch test). Compare by path_key. Related: client: duplicate or case-folded bundle manifest paths poison the skip set #2691, client: Win32 name aliasing (trailing dot/space, :, 8.3 names) can make two bundle entry paths one file #2746.
  • Node metrics server. crates/node/src/metrics.rs:4316: the HTTP/1 builder sets no .timer(..), so hyper's header timeout is silently disabled. There is no keep-alive bound and no Host check, and 32 permits are held until peers close (scratch test). Set the timer and a header timeout, bound keep-alive, and apply the loopback Host check the admin listener got in node: admin JSON-RPC server has no Host/Origin filter (DNS rebinding reaches evict and drain) #2690.
  • NodeId re-seat after blacklist ejection. contracts/src/CapacityBond.sol:1028: a blacklist-ejected operator can reclaimNodeId from a fresh address (it holds the iroh key) and re-register the same NodeId. The blacklistEjected latch covers only the Ethereum address, and ejectNode does not force unbonding (ADR 011:224). Latch the NodeId too, and correct ADR 011 and the key-rotation appendix. Check against Reduce ContentBlacklist to regional tag lists; retire blacklist slashing and operator ejection #2916, which retires operator ejection.

Edited: the "Cumulative pausedTotal" item (SlashEscrowLib, SlashAppeal) was removed as moot, since slashing is retired (#2917, #2938). The attestation-verifier item now asks for registration status instead of stake, since the bond is being replaced.

Activity

  1. added
    kind:security
    on Nov 5, 2026
  2. added theissue type on Nov 5, 2026
  3. added
    area:cli
    prio:low
    area:contracts
    area:node
    on Nov 5, 2026
  4. added
    area:payments
    area:sponsord
    area:client
    on Nov 5, 2026
  5. yigitdot commented on Nov 17, 2026

    @yigitdot
    Contributor

    Status on main (116f9e9): #2872 (fcbe2e0) fixes items 2 and 9 and most of item 10. Its commit message cites this issue for each:

    • config init file mode: decdn config init writes node.toml 0600 and creates its directory 0700.
    • Reserved pull-state paths are case-sensitive: .decdn-partial, .decdn-manifest.json and .decdn-bundles compare by path_key.
    • Node metrics server (partial): hyper's timer, a 10 s header read timeout and a 60 s connection lifetime are set. The loopback Host check is still missing from crates/node/src/metrics.rs.

    The other eight items still reproduce on main.

  6. yigitdot commented on Nov 26, 2026

    @yigitdot
    Contributor

    Status on main (e720fbb), since the 2026-11-17 status:

    • Attestation persisted before the pull lands: mostly addressed by feat!: origin attestations are namespace-scoped, expiring and required to serve #2921 (ff7868f). A refresh runs only while the node holds the blob. An attestation for a blob the node no longer holds, or never landed, is dropped at refresh time (crates/node/src/node_origin/attestation_refresh.rs). The handshake still writes the attestation before the pull lands, so the drop is lazy.
    • Attestation verifier ignores registration status: still open. admits checks seat and deny-set only (crates/node/src/dht/attestation.rs).
    • Still open with no change: voucher rate tolerance (DEFAULT_TOLERANCE_BPS = 100), the per-namespace gateway known-signer budget, the shared onramp overflow window, the ConnectInfo doc in docs/sponsord/integrator.md, the metrics-server loopback Host check, and NodeId re-seat after ejection (reclaimNodeId has no latch).
  7. alpergundogdu commented on Nov 26, 2026

    @alpergundogdu
    Contributor

    #3011 covers two items here: Onramp overflow window (untracked clients spread over 1,024 keyed-hash overflow windows) and Onramp without ConnectInfo (integrator guide serves with into_make_service_with_connect_info; the library warns once at the first request with no peer address and no client-IP header, since it cannot see at startup how an embedder serves the router).

  8. alpergundogdu commented on Nov 27, 2026

    @alpergundogdu
    Contributor

    Status of every item, on main (3750aff) plus #3031:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliarea:clientarea:contractsarea:nodearea:paymentsarea:sponsordkind:securityprio:low

Type

Fields

Priority

None yet

Projects

  • Status
    Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions