Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discv5: include plain id-nonce into HANDSHAKE packet #164

Open
mkalinin opened this issue Oct 6, 2020 · 0 comments
Open

discv5: include plain id-nonce into HANDSHAKE packet #164

mkalinin opened this issue Oct 6, 2020 · 0 comments

Comments

@mkalinin
Copy link
Contributor

mkalinin commented Oct 6, 2020

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. 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.

@fjl fjl added this to the Discovery v5.2 milestone Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants