Skip to content

Per-IP and per-source rate layers are free to bypass via relay-only connections #2505

Closed

Description

@thiras

Problem

Every per-source / per-IP layer skips relay-only connections, so it binds no attacker who dials through the relay:

peer_ip returns None when the connection has only a relay path. An attacker who dials through the node's home relay with no direct address carries no source key. NodeIds cost nothing, so the per-peer layer does not bind them either. On a relay-only path, only the global layer applies.

The ADRs justify these layers by saying "IP rotation requires money" (ADR 005 § Probe rate limiting, ADR 022). That is true for direct paths. For an attacker who chooses the relay, it is free.

Open question

Run the per-IP / per-source layers through the spec-discipline gates. Gate 2 (attacker binding) is the main one.

  • For keeping them: they still limit floods from direct IPs. A direct path is the default, and it is cheaper for the attacker than relayed bandwidth. Relays may meter or limit what they forward, which would make the relay path a real cost. Check what the n0 relay enforces.
  • For cutting them: an attacker can bypass them for free, while honest peers behind NAT share their buckets. Each also adds a keyed map, a prune task, metrics and config knobs.
  • Something in between: keep the layer and let relay-only connections share one bucket. The cost is that honest relay-only peers would share a budget.

The outcome may be "keep as-is". If so, record why, and correct the ADR text (#2504).

Related: #2502, which kept a per-source connection-count cap out for the same binding reason.

Activity

  1. self-assigned this
    on Oct 17, 2026
  2. assigned and unassigned on Oct 17, 2026
  3. yigitdot commented on Oct 21, 2026

    @yigitdot
    Contributor

    The ADR-text leg (#2504) is done in #2579: both Per-IP rows and both "Why three layers" paragraphs now state that the key is the direct-path source IP (/64 for IPv6) and that a relay-only connection passes the layer unchecked, bounded by the per-peer and global layers. The open design question here (keep as-is / cut / shared relay bucket) is unchanged.

  4. added
    area:node
    kind:security
    on Oct 21, 2026
  5. moved this from Backlog to In progress in deCDNon Nov 11, 2026
  6. moved this from In progress to Done in deCDNon Nov 13, 2026
  7. added a commit that references this issue on Nov 17, 2026
    95da7ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:nodekind:security

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions