Ignore large pings #63

Open
opened 3 years ago by duke · 5 comments
duke commented 3 years ago
Owner

This bug was likely inherited from BTC 0.11 by ZEC, which means we likely have it as well.

https://github.com/zcash/zcash/issues/5258

HUSH nodes should probably disconnect from peers which send overly large pings, since they don't happen normally and probably indicates a mischevious node

This bug was likely inherited from BTC 0.11 by ZEC, which means we likely have it as well. https://github.com/zcash/zcash/issues/5258 HUSH nodes should probably disconnect from peers which send overly large pings, since they don't happen normally and probably indicates a mischevious node
Poster
Owner

Another option here are to give no response but keep the peer connection open. In either case, we should log to debug.log when these large pings are seen, as it's indicative of a node with custom code that is potentially malicious.

There does not seem to be any privacy issues with this bug, but it does waste network bandwidth and so it has Denial-of-Service considerations. An attacker can continually send large pings and waste lots of network bandwidth of all their peers. This is mostly a concern for peers that have small amounts of bandwidth and/or pay for bandwidth.

Another option here are to give no response but keep the peer connection open. In either case, we should log to debug.log when these large pings are seen, as it's indicative of a node with custom code that is potentially malicious. There does not seem to be any privacy issues with this bug, but it does waste network bandwidth and so it has Denial-of-Service considerations. An attacker can continually send large pings and waste lots of network bandwidth of all their peers. This is mostly a concern for peers that have small amounts of bandwidth and/or pay for bandwidth.
Poster
Owner

What size, in bytes, should we allow for PINGs ?

What size, in bytes, should we allow for PINGs ?
Collaborator

This looks like an interesting change that we should implement.

This looks like an interesting change that we should implement.
jahway603 self-assigned this 2 years ago
Poster
Owner

Some research to do is:

  • What size in bytes is a normal Hush full node PING ?
  • Are pings a fixed static size or can they be a range of sizes?

NOTE: Hush full node pings are not TCP pings, this is a p2p message type which tells a node how long it takes another node to process our p2p messages. It's used internally for nodes to know which nodes are faster in responding and to prefer those. For instance, some nodes might be on shitty internet and have high latency, and that will result in a large ping response time.

Some research to do is: - [ ] What size in bytes is a normal Hush full node PING ? - [ ] Are pings a fixed static size or can they be a range of sizes? NOTE: Hush full node pings are not TCP pings, this is a p2p message type which tells a node how long it takes another node to process our p2p messages. It's used internally for nodes to know which nodes are faster in responding and to prefer those. For instance, some nodes might be on shitty internet and have high latency, and that will result in a large ping response time.
Poster
Owner
@jahway603 some code you may want to read about pings are here: https://git.hush.is/hush/hush3/src/branch/master/src/net.cpp#L652 and https://git.hush.is/hush/hush3/src/branch/master/src/net.h#L387
duke added the
bug
label 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.