ethereum / ethereum/devp2p

discv5: include plain id-nonce into HANDSHAKE packet

Open
#164 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.1k
Forks
297
Avg merge
5h 50m
Merged PRs (30d)
1

Description

This issue is a proposal to bring back plain `id-nonce` in a `HANDSHAKE` packet. `id-nonce` is sent by remote peer during handshake process in a `WHOAREYOU` packet.

In discv5.1 this field has been removed from the `HANDSHAKE`.

### Rationale
Plain `id-nonce` allows for a sanity check on whether remote peer accounted `WHOAREYOU` packet (received and parsed it) before sending `HANDSHAKE` or not.

One may send the same packet twice (with some timeout) to trigger signature verification. First message is treated as random packet and initiates the handshake with egress `WHOAREYOU` message. The second message arrives disregarding the `WHOAREYOU` that was sent and is treated as `HANDSHAKE` and triggers signature verification.

The worse attack scenario could be played with help of relatively cheap [spoofed vps](https://www.clientvps.com/service/spoofed-vps). One may be constantly sending the same pair of messages from multiple identities in parallel (DDoS) causing multiple signature verifications at a time.

### Solution
An optimal solution from @fjl that does not increase the size of the `HANDSHAKE`:

> there is a good way to address this without increasing the handshake packet size even more: just replace the `src-id` with `id-nonce`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.