I just had 213.26.168.50 perform a denial of service against Tor26. It opened over
5000 connections to tor26, which not only ate a bit of CPU, but also used up all
available file descriptors, causing tor26 to drop new connections:
Jul 23 13:26:11.701 [notice] accept failed: Too many open files. Dropping incoming connection.
Please implement some limit of connections per clients. There are a few other
minor abusers too, which probably means this also could use some thinking at
the client:
As a first step, we should limit the number of not-yet-successfully-handshaked
connections from a given IP address. I'm guessing these 5500 connections were
just holding the TCP connection open, and didn't actually do an SSL handshake.
My firewall only allows max 50 connections that are not handshaked yet and i can't set it higher (only lower ;)).
So i get many many SYN FLOOD messages when i run the server. Should the suggestion above solve this problem? It
would be nice if i could run the server again.
I'm getting these same kind of attacks about once a week too. (I'm running a relay with no exit)
My "/var/log/tor/tor.log" file gets filled with
"[notice] accept failed: Too many open files. Dropping incoming connection."
After tor.log grows in size to ~3G my /var/log partition is full, interfering with other
services running on that server. I'm going to try disabling DirPort setting in /etc/tor/torrc for now.
I have an ADSL internet connection with a dd-wrt router bridged to my ADSL modem.
I am port forwarding the tor ports from the dd-wrt router to my tor server running iptables.
I run a blacklist script to dynamically add new chains to iptables to block IPs with too many failed
ssh logins. Not sure if there's a script to do something similar for tor by blocking IPs with too many
connections.
I think what Roger said about the ssl handshake on OR server connections
can be applied to Dir server connections as well. There should be a limit
of how many Dir conns a client has stuck in DIR_CONN_STATE_SERVER_COMMAND_WAIT.
On my testing server, I can use netcat to connect to the OR port and Dir port
and it just hangs, which is certainly wasteful if a client opens up a ton of
connections.
There could be a new configuration option -- something like
MaxUnusedConnections -- which would limit the total number of unhandshaked OR
conns and unused Dir conns the client can have open at the same time to a set
number before Tor starts to deny further access from their IP.
Trac: Description: I just had 213.26.168.50 perform a denial of service against Tor26. It opened over
5000 connections to tor26, which not only ate a bit of CPU, but also used up all
available file descriptors, causing tor26 to drop new connections:
Jul 23 13:26:11.701 [notice] accept failed: Too many open files. Dropping incoming connection.
Please implement some limit of connections per clients. There are a few other
minor abusers too, which probably means this also could use some thinking at
the client:
[Automatically added by flyspray2trac: Operating System: All]
to
I just had 213.26.168.50 perform a denial of service against Tor26. It opened over
5000 connections to tor26, which not only ate a bit of CPU, but also used up all
available file descriptors, causing tor26 to drop new connections:
Jul 23 13:26:11.701 [notice] accept failed: Too many open files. Dropping incoming connection.
Please implement some limit of connections per clients. There are a few other
minor abusers too, which probably means this also could use some thinking at
the client:
[Automatically added by flyspray2trac: Operating System: All] Status: new to needs_review Keywords: N/Adeleted, N/Aadded Parent: N/AtoN/A Milestone: post 0.2.1.x to Tor: 0.2.3.x-final
Hm, no. We're going to want a different solution here than the one in the linked-to patch. It limits the number of unused connections per IP, which is a good thing, but trivial to circumvent. We also need to limit the number of concurrent connections and the rate of connection attempts.
This should be resolved with #24902 (moved) which limits the number of concurrent connections from client IP address. As long as you are a public relay, you should defend.
We might want to improve on this for dirauth with #4581 (moved).