Skip to content
This repository has been archived by the owner on Nov 20, 2021. It is now read-only.

[lighthouse-attack-0 Issue] Network agent crashes lighthouse discovery #4

Closed
jrhea opened this issue Jul 23, 2020 · 2 comments
Closed

Comments

@jrhea
Copy link
Contributor

jrhea commented Jul 23, 2020

Description

A network agent, capable of creating a large number of discv5 sessions, crashed the discovery service on several lighthouse nodes.

Attack scenario

A large number of simultaneous discv5 sessions established with a lighthouse node will fill up the session cache causing sessions to expire quickly. This can lead to a scenario where sessions and requests are no longer in sync and the handling of a delayed response can trigger an exception.

Impact

The attack left 3 of 4 nodes without the ability to discover or be discovered by new peers.

Details:

The following log is from the code that triggered the fault. You can see that at Jul 20 11:36:50.903 CDT it is connected to one of the nodes, then it loses the connection a few seconds later. This corresponds to the outage on the attacknet node.

imp: 
 Jul 20 11:36:26.684 INFO Starting imp
 imp: NetworkService
  Network Service: Crawler
   Jul 20 11:36:26.685 INFO Found 1 bootstrap enrs
   Jul 20 11:36:26.690 INFO Local Node Id: 0xad05..51af
   Jul 20 11:36:26.746 INFO calling find_node()
   Jul 20 11:36:34.907 INFO Connected Peers: 0
   Jul 20 11:36:34.907 INFO Enr Entries: 1
   Jul 20 11:36:34.907 INFO Output is enabled.  Saving data to file
   Jul 20 11:36:36.747 INFO calling find_node()
   Jul 20 11:36:44.897 INFO Connected Peers: 0
   Jul 20 11:36:44.898 INFO Enr Entries: 1
   Jul 20 11:36:46.750 INFO calling find_node()
   Jul 20 11:36:50.903 INFO Connected Peers: 1
   Jul 20 11:36:50.903 INFO Enr Entries: 1
   Jul 20 11:36:56.750 INFO Output is enabled.  Saving data to file
   Jul 20 11:36:56.750 INFO calling find_node()
   Jul 20 11:37:04.898 INFO Connected Peers: 0
   Jul 20 11:37:04.898 INFO Enr Entries: 1
   Jul 20 11:37:06.751 INFO calling find_node()
   Jul 20 11:37:14.904 INFO Connected Peers: 0
   Jul 20 11:37:14.904 INFO Enr Entries: 1
   Jul 20 11:37:16.749 INFO calling find_node()
   Jul 20 11:37:24.895 INFO Connected Peers: 0
   Jul 20 11:37:24.895 INFO Enr Entries: 1
   Jul 20 11:37:26.749 INFO calling find_node()
   Jul 20 11:37:34.898 INFO Connected Peers: 0
   Jul 20 11:37:34.898 INFO Enr Entries: 1
   Jul 20 11:37:34.898 INFO Output is enabled.  Saving data to file
   Jul 20 11:37:36.751 INFO calling find_node()
   Jul 20 11:37:44.899 INFO Connected Peers: 0
   Jul 20 11:37:44.899 INFO Enr Entries: 1
   Jul 20 11:37:46.752 INFO calling find_node()
   Jul 20 11:37:54.902 INFO Connected Peers: 0
   Jul 20 11:37:54.902 INFO Enr Entries: 1
   Jul 20 11:37:56.748 INFO Output is enabled.  Saving data to file
   Jul 20 11:37:56.749 INFO calling find_node()
   Jul 20 11:38:04.903 INFO Connected Peers: 0
   Jul 20 11:38:04.903 INFO Enr Entries: 1
   Jul 20 11:38:06.752 INFO calling find_node()
   Jul 20 11:38:14.904 INFO Connected Peers: 0
   Jul 20 11:38:14.904 INFO Enr Entries: 1
   Jul 20 11:38:16.752 INFO calling find_node()
   Jul 20 11:38:24.755 INFO Connected Peers: 0
   Jul 20 11:38:24.755 INFO Enr Entries: 1
   Jul 20 11:38:26.735 INFO calling find_node()
   Jul 20 11:38:34.740 INFO Connected Peers: 0
   Jul 20 11:38:34.740 INFO Enr Entries: 1
   Jul 20 11:38:34.740 INFO Output is enabled.  Saving data to file
   Jul 20 11:38:36.724 INFO calling find_node()
   Jul 20 11:38:44.738 INFO Connected Peers: 0
   Jul 20 11:38:44.739 INFO Enr Entries: 1
   Jul 20 11:38:46.718 INFO calling find_node()
   Jul 20 11:38:54.730 INFO Connected Peers: 0
   Jul 20 11:38:54.730 INFO Enr Entries: 1
   Jul 20 11:38:56.720 INFO calling find_node()
   Jul 20 11:39:04.737 INFO Connected Peers: 0
   Jul 20 11:39:04.737 INFO Enr Entries: 1
   Jul 20 11:39:04.737 INFO Output is enabled.  Saving data to file
   Jul 20 11:39:06.718 INFO calling find_node()
   Jul 20 11:39:14.732 INFO Connected Peers: 0
   Jul 20 11:39:14.732 INFO Enr Entries: 1
   Jul 20 11:39:16.715 INFO calling find_node()
   Jul 20 11:39:20.778 WARN Sending shutdown signal.
 imp: Agent
  Jul 20 11:39:20.778 WARN "imp_agent::agent::Agent": shutdown message received.
 imp: NetworkService
  Jul 20 11:39:20.778 WARN "imp_network::service::Service": shutdown message received.
 Jul 20 11:39:22.087 WARN Exiting imp.
Post processing starting...
Post processing complete
exit
@djrtwo djrtwo changed the title [{lighthouse-attack-0} Issue] [lighthouse-attack-0 Issue] Jul 23, 2020
@djrtwo djrtwo changed the title [lighthouse-attack-0 Issue] [lighthouse-attack-0 Issue] Network agent crashes lighthouse discovery Jul 23, 2020
@djrtwo
Copy link
Collaborator

djrtwo commented Jul 23, 2020

Thank you @jrhea!

@AgeManning fixed this here sigp/lighthouse#1373 and the fix has been deployed to lighthouse-attack-0. Thank you :)

This issue qualifies for an honorable mention with a reward of $1k USD along with your name on the (soon to be) attacknet trophy section 🏆

@jrhea
Copy link
Contributor Author

jrhea commented Jul 23, 2020

I think the "Jonny Prevention Patch" 😂 that @AgeManning made is in the discv5 repo:

sigp/discv5#24

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@djrtwo @jrhea and others