-
Notifications
You must be signed in to change notification settings - Fork 42
Nodejoin Spam and Temp Queue size attack #26
Comments
This is a real problem.
But using external utilities is not the solution. |
I can't find mine nyzo log i saved, i only have whole tcp dump but it can be seen some IPs are spamming it some source IP that sent packets more then dozen xx in 2min: this is only what i checked first few IPs as its tcp dump only some do spam, but it clearly can be seen that they where ddos mostly from amazon IPs |
Some of my verifier stats dropped nodes due to temp queue being full from Verifer https://nyzo.co/status?id=18c6.0af8 from Verifer https://nyzo.co/status?id=1397.8327 IPs sending much more nodejoin message than usual from Verifer https://nyzo.co/status?id=18c6.0af8 from Verifer https://nyzo.co/status?id=1397.8327 |
Latest victim from nodejoin spam
Owner sent me its log and feedback. added new out-of-cycle node to queue: d931...a383 Goes on and on. Verifier was protected by a v595 Sentinel. That sentinel was found stuck in "uncertain" state, not updating anymore, maybe as a result of its managed verifiers being spammed and lagging. |
I think any possible ddos with join or any other mean should be defined what is ok and what is ddos and that code be pushed in main repo, so if normal node do 1-2 join msg per some time, then we need to set some limits and ban all the rest that cross the line nodes that did most join spam: |
More logs from the Radiofoot verifier attached. Number of removed nodes from 1000 slots temp file, during that period: Number of new out of cycle added (not nodejoins, new temp adds) IPs and nodejoins were not logged on that instance. |
How are things going with the fight against nodejoin spam? |
As far I know you have to wait 24h for your queue node to be visible... |
@cobra-lab Not all in-cycles verifiers are heavily targetted atm. |
My verifier got this "queue attack" too,these new nodes are all amazon ips,version 595,verifier nicknames FastQ8 Techgo20 Sleeping 4 inFACT19 ... cleaning up because block 8970372 was frozen |
@dystophia proposed this patch - handling auto ban of spamming ips - to open-nyzo |
By mitigating the memory and resource use of incoming nodejoin messages, v572 opens for a new kind of attack:
To enter the cycle, you have to enter the queue ("nodes" file).
Since 572, to enter that queue you first have to enter a - size limited - temporary queue.
The size of this temporary queue is static, currently 1000.
The scarce resource to enter the real queue is no more IPv4, it's a slot in that temporary queue.
Several things gave me hints:
The extended logging from my NCFP-10 PR was aimed at collecting data, but also run an optional extra script to auto mitigate these attacks, by rate-limiting them.
When a verifier is subject to nodejoin spam, its log looks like:
[1596735532.002 (2020-08-06 17:38:52.002 UTC)]: added new out-of-cycle node to queue: 6c31...076d
[1596735532.003 (2020-08-06 17:38:52.003 UTC)]: removed node from new out-of-cycle queue due to size
[1596735532.004 (2020-08-06 17:38:52.004 UTC)]: nodejoin_from 3.248.137.142 6c31...076d Launch9
[1596735532.023 (2020-08-06 17:38:52.023 UTC)]: added new out-of-cycle node to queue: 3c94...c24b
[1596735532.023 (2020-08-06 17:38:52.023 UTC)]: removed node from new out-of-cycle queue due to size
[1596735532.026 (2020-08-06 17:38:52.026 UTC)]: nodejoin_from 44.226.163.107 3c94...c24b WWW_BUY_COM 16
[1596735532.033 (2020-08-06 17:38:52.033 UTC)]: nodejoin_from 44.227.41.15 4cc5...7e91 New12 here
[1596735532.034 (2020-08-06 17:38:52.034 UTC)]: added new out-of-cycle node to queue: ecbf...c341
[1596735532.035 (2020-08-06 17:38:52.035 UTC)]: removed node from new out-of-cycle queue due to size
[1596735532.038 (2020-08-06 17:38:52.038 UTC)]: added new out-of-cycle node to queue: 91fc...b7ec
[1596735532.038 (2020-08-06 17:38:52.038 UTC)]: removed node from new out-of-cycle queue due to size
[1596735532.038 (2020-08-06 17:38:52.038 UTC)]: nodejoin_from 44.226.13.107 91fc...b7ec Foxwie10
[1596735532.049 (2020-08-06 17:38:52.049 UTC)]: nodejoin_from 35.183.163.76 ecbf...c341 ZBank16
[1596735532.061 (2020-08-06 17:38:52.061 UTC)]: added new out-of-cycle node to queue: db0e...f9bc
[1596735532.061 (2020-08-06 17:38:52.061 UTC)]: removed node from new out-of-cycle queue due to size
This goes on and on, with around 100 nodejoins per second.
The logs show the process is effective: many many temp nodes do drop off the temp queue.
When the temp queue is full - and it clearly is in these occasions - then every time a new nodejoin comes in, a random node from the temp queue drops.
Send enough and you wipe out almost everyone else.
If you can borrow more than 1000 ips, even for a short period of time (amazon ips, alibaba, socks proxies, botnets, some blockchains renting their nodes: renting 10k ips is easy and cheap)
then you can flood the temp queue of the in-cycle nodes, get all new temp candidates out and have more chances only yours remain.
Spam with temp ips, spam with your new nodes ips, you enter the real queue, others don't.
Regularly spam nodejoin with borrowed ips, you make it statistically harder for others to join.
This is not a very efficient attack. It would need to be done at scale and in a continuous way to be useful,
However, the logs show this does happen IRL, and in a continuous way (at least on some verifiers)
Another sample from a node that already banned a lot of spamming ips:
[1597137583.389 (2020-08-11 09:19:43.389 UTC)]: removed node from new out-of-cycle queue due to size
[1597137583.390 (2020-08-11 09:19:43.390 UTC)]: nodejoin_from 44.227.158.100 6ed0...ca7a NowFuture14
[1597137583.395 (2020-08-11 09:19:43.395 UTC)]: added new out-of-cycle node to queue: e37e...e3e4
[1597137583.396 (2020-08-11 09:19:43.396 UTC)]: nodejoin_from 99.79.142.3 e37e...e3e4 DoYouW0
[1597137583.411 (2020-08-11 09:19:43.411 UTC)]: nodejoin_from 50.116.12.77 8a1d...de82 feiya200_u
[1597137583.417 (2020-08-11 09:19:43.417 UTC)]: added new out-of-cycle node to queue: 8adb...5069
[1597137583.417 (2020-08-11 09:19:43.417 UTC)]: removed node from new out-of-cycle queue due to size
[1597137583.420 (2020-08-11 09:19:43.420 UTC)]: added new out-of-cycle node to queue: f968...6fc3
[1597137583.420 (2020-08-11 09:19:43.420 UTC)]: removed node from new out-of-cycle queue due to size
[1597137583.420 (2020-08-11 09:19:43.420 UTC)]: nodejoin_from 99.79.129.23 8adb...5069 PACITES4
[1597137583.422 (2020-08-11 09:19:43.422 UTC)]: added new out-of-cycle node to queue: 0a40...6494
[1597137583.422 (2020-08-11 09:19:43.422 UTC)]: nodejoin_from 99.79.175.115 f968...6fc3 noNation19
[1597137583.422 (2020-08-11 09:19:43.422 UTC)]: nodejoin_from 52.39.118.45 0a40...6494 Detail POD 17
[1597137583.424 (2020-08-11 09:19:43.424 UTC)]: added new out-of-cycle node to queue: 0533...5c9f
[1597137583.424 (2020-08-11 09:19:43.424 UTC)]: removed node from new out-of-cycle queue due to size
Temp queue full, nodes dropping. This is happening, since weeks if not more. This node can hardly see real new candidates.
The bottleneck is the temp queue size.
In addition to the temp queue size "attack", the heavy nodejoin spam itself is an effective DoS attack.
It now seems to be targetted toward low mesh count verifiers, and/or verifiers running a xxx001 version.
In cycle verifiers under attack experience high cpu load, ram usage, can swap and end up in a state where they can't follow the cycle anymore.
Some technical users had to modify the code or use xxx001 version to get extended IP log of the attacks, so to identify the sources of the attacks and ban them via iptables - (Mostly amazon ec2 ips).
The text was updated successfully, but these errors were encountered: