Skip to content

ADR 005: No redirect loop prevention — missing hop limit and cycle detection #69

Closed

Description

@thiras

Category: Missing Specification

Severity: HIGH

File: adr/005-protocol.md (~lines 66-68)

A node can return a StreamResponse with redirect pointing to another NodeId. There's no TTL, hop limit, or cycle detection specified.

Attack scenario:

  1. Node A receives StreamRequest for hash X
  2. Node A redirects to Node B
  3. Node B redirects back to Node A
  4. Client bounces indefinitely, wasting bandwidth and time

This can also happen accidentally if two nodes both have cache misses and redirect to each other.

Recommendation:

  1. Add a max redirect depth (e.g., 3 hops) — client refuses further redirects after the limit
  2. Require clients to track visited NodeIds per request and reject cycles
  3. Consider adding a hop_count field to StreamRequest so nodes can also refuse to redirect if the count is too high

ADRs affected

  • ADR 005 (Wire Protocol)

Activity

  1. added
    design:missing-decision
    on Mar 31, 2026
  2. added a commit that references this issue on Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:missing-decision

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions