[tor-relays] Tor 0.4.9.15 released - New DoS defenses

Greetings operators!

Today, we released tor 0.4.9.15 which contains three new DoS defenses aimed at
mitigating the BEGIN_DIR thunderstorm attack we've all been experiencing.

Quick data point (or refresher): BEGIN_DIR is a cell type that tor uses to send
directory documents requests (ex: fetch consensus) over a circuit.

Here are the details of the defenses and what to expect on the MetricsPort.

1. BEGIN_DIR rate limit per circuit: default On

Exactly like the stream DoS defense (DoSStreamCreationRate), we put in a rate
limit for BEGIN_DIR which applies to relays and bridges.

With it, 4 new torrc options that are also consensus parameters:

    DoSBeginDirRateEnabled (default 1),
    DoSBeginDirRate (default 10)
    DoSBeginDirBurst (default 60)
    DoSBeginDirDefenseType (1 = no defense, 2 = refuse the stream, 3 = close the circuit; default 3).

You DO NOT need to set these, please leave the consensus set those at the
moment.

MetricsPort new counter which is also present in the DoS heartbeat log line:

  tor_relay_dos_total{type="begindir_rate_rejected"}

2. One BEGIN_DIR per circuit from relays: default Off.

A circuit that arrives from another relay, meaning its previous hop
authenticated as a relay, may carry only one BEGIN_DIR over its whole lifetime.

This behavior is solely controlled by the consensus with
DoSBeginDirLimitEnabled as it shouldn't be flipped on individual relays as it
can possibly lead to network degradation. We need most of the network to
upgrade before we can turn this on.

MetricsPort new counter which is also present in the DoS heartbeat log line:

    tor_relay_dos_total{type="begindir_rejected"}

3. One HSDir request per circuit: Always On.

An HSDir now accepts at most one onion service descriptor fetch or upload per
circuit. A second HS descriptor request on the same circuit closes the circuit.

MetricsPort new counter which is also present in the DoS heartbeat log line:

  tor_relay_dos_total{type="begindir_hsdir_rejected"}

We expect these defenses to mitigate the vast majority of BEGIN_DIR requests
that we are seeing from this attack. However, this won't magically make the
hundreds of circuits per second we see on a single relay disappear. You will
still experience an heavy load as long as the attacker is doing their thing...

There is also a big change to how directory authorities assign the HSDir flag,
it is now sticky, meaning it survives a relay restart. A relay still needs 96
hours of uptime to get the HSDir flag the first time but once it has the flag
and stays in the consensus, it keeps it. If your relay drops out of the
consensus, the uptime requirement applies again. All other HSDir requirements
(Stable, Fast, Running, DirCache 1) still apply as before. At this moment, we
have a majority of authorities already upgraded to 0.4.9.15.

One last important point. If you added "DirCache 0" to your torrc during this
DoS attack, please remove it and see if things improve for your relay. The main
issue with disabling DirCache is that you're effectively opting out of serving
as a Fallbackdir, Guard, HSDir, and a directory cache. The network really needs
these nodes so we'd strongly encourage you to revert that option.

These are significant changes so we'd appreciate everyone's help in letting us
know if you notice anything wrong or behaving unexpectedly. You can do so by
writing on this list or via our Gitlab at https://gitlab.torproject.org.

None of this work would have been possible without the help of several relay
operators who generously gave their time and knowledge. We can't thank you
enough for your help and to everyone running relays!!!

Cheers!
David

···

--
MCgfKt8Z71zgn/ZfkxQViFHsfNFGHjprU2EQX+0o9HQ=

3 Likes

* David Goulet via tor-relays:

Today, we released tor 0.4.9.15 which contains three new DoS defenses
aimed at mitigating the BEGIN_DIR thunderstorm attack we've all been
experiencing.

I have not expressed my thanks to the Tor team for quite a while, and I
think this is a suitable occasion to remedy my silence.

Thank you for your continued work to make Tor safer and more resilient
in the face of hostile actors. I imagine that the serious attackers out
there can draw on greater numbers in both manpower and budget, and still
the Tor team fights back. I find this impressive.

-Ralph

···

_______________________________________________
tor-relays mailing list -- tor-relays@lists.torproject.org
To unsubscribe send an email to tor-relays-leave@lists.torproject.org

1 Like

Since I got the flags back I think the attacker has been back. 10% more tx than rx.

Traffic is ramping up but so far the relay is running fine. Normal CPU so no risk of losing flags again *fingers crossed*

···

On 10/30/26 16:59, kullikovana via tor-relays wrote:

Hi guys
Is the new update working well? I dont have the flags yet because ive lost them five times because of the attacks so im interested to hear

_______________________________________________
tor-relays mailing list -- tor-relays@lists.torproject.org
To unsubscribe send an email to tor-relays-leave@lists.torproject.org

_______________________________________________
tor-relays mailing list -- tor-relays@lists.torproject.org
To unsubscribe send an email to tor-relays-leave@lists.torproject.org

_______________________________________________
tor-relays mailing list -- tor-relays@lists.torproject.org
To unsubscribe send an email to tor-relays-leave@lists.torproject.org

:slight_smile:
Oh, lovely—that’s something I (and many others) have been wishing for for a
long time. Hopefully, this will make the attacks more time-consuming and
expensive.

I'm in favor of a 'ramp-up' phase for Guard, exit¹ & HSDir flag.
¹AFAIK, it's being planned for Arti.

···

On Wednesday, 28 October 2026 19:19:44 CET David Goulet via tor-relays wrote:

There is also a big change to how directory authorities assign the HSDir
flag, it is now sticky, meaning it survives a relay restart. A relay still
needs 96 hours of uptime to get the HSDir flag the first time but once it
has the flag and stays in the consensus, it keeps it. If your relay drops
out of the consensus, the uptime requirement applies again. All other HSDir
requirements (Stable, Fast, Running, DirCache 1) still apply as before.

--
╰_╯ Ciao Marco!

Debian GNU/Linux

It's free software and it gives you freedom!

1 Like

I run the relay 8F6A78B1EA917F2BF221E87D14361C050A70CCC3

After 14 days with 0.4.9.15 and HSDir flag my relay today got 3.5 hours of overloading attack. Received fell from 36 to about 10Mbit/s. transmitted rose from 36 to 72Mbit/s. Once the DirAuths pulled the HSDir flag the attacker had achieved it's goal and went on to other targets.

Main Tor thread was pegged at 100% during but memory only grew from 1.6Gb to 2Gb. The log was spammed with overloaded warnings.

DirAuths being so trigger happy about pulling the HSDir flag really makes it easy for the attacker.

At least the relay got to keep the Stable flag (for now).

···

On 10/30/26 19:52, Logforme via tor-relays wrote:

Since I got the flags back I think the attacker has been back. 10% more tx than rx.

Traffic is ramping up but so far the relay is running fine. Normal CPU so no risk of losing flags again *fingers crossed*

_______________________________________________
tor-relays mailing list -- tor-relays@lists.torproject.org
To unsubscribe send an email to tor-relays-leave@lists.torproject.org

I investigated this part to make sure things are behaving as designed
(which is a separate question from whether the design should change).

Based on

Logforme3 was in the 2026-11-12 00UTC through 13UTC consensuses, then
was out of the 14UTC and 15UTC consensuses, then came back starting at
the 16UTC consensus.

So in that sense, you were no longer an HSDir for those two missing
hours because you didn't even have the Running flag (and changing only
the HSDir flag assignment would not be enough for fixing that part).

I looked at moria1's reachability tests and I confirm that you were
consistently reachable up through Nov 12 12:08:07.068 UTC and the next
time I succeeded at a reachability test was Nov 12 15:41:29.241 UTC.

So (wearing my directory authority hat rather than network designer
hat), it's not clear to me that giving you the HSDir flag again when
you managed to return would have made your day better. :slight_smile:

--Roger

···

On Thu, Nov 12, 2026 at 08:33:38PM +0100, Logforme via tor-relays wrote:

After 14 days with 0.4.9.15 and HSDir flag my relay today got 3.5 hours of
overloading attack. Received fell from 36 to about 10Mbit/s. transmitted
rose from 36 to 72Mbit/s. Once the DirAuths pulled the HSDir flag the
attacker had achieved it's goal and went on to other targets.

_______________________________________________
tor-relays mailing list -- tor-relays@lists.torproject.org
To unsubscribe send an email to tor-relays-leave@lists.torproject.org

"when you managed to return" sounds like I had any influence over what is happening here :slight_smile:

···

On 11/12/26 21:29, Roger Dingledine via tor-relays wrote:

On Thu, Nov 12, 2026 at 08:33:38PM +0100, Logforme via tor-relays wrote:

After 14 days with 0.4.9.15 and HSDir flag my relay today got 3.5 hours of
overloading attack. Received fell from 36 to about 10Mbit/s. transmitted
rose from 36 to 72Mbit/s. Once the DirAuths pulled the HSDir flag the
attacker had achieved it's goal and went on to other targets.

So (wearing my directory authority hat rather than network designer
hat), it's not clear to me that giving you the HSDir flag again when
you managed to return would have made your day better. :slight_smile:

_______________________________________________
tor-relays mailing list -- tor-relays@lists.torproject.org
To unsubscribe send an email to tor-relays-leave@lists.torproject.org

It looks like the attacker is just bypassing the sticky HSDir feature by
maintaining the attack until the relay loses its Running flag. One of my
relays just suffered a similar attack which continued until it had been
entirely kicked out of the consensus, and then stopped immediately.

Regards,
forest

···

On 2026-11-12 20:29, Roger Dingledine via tor-relays wrote:

So in that sense, you were no longer an HSDir for those two missing
hours because you didn't even have the Running flag (and changing only
the HSDir flag assignment would not be enough for fixing that part).

I looked at moria1's reachability tests and I confirm that you were
consistently reachable up through Nov 12 12:08:07.068 UTC and the next
time I succeeded at a reachability test was Nov 12 15:41:29.241 UTC.

_______________________________________________
tor-relays mailing list -- tor-relays@lists.torproject.org
To unsubscribe send an email to tor-relays-leave@lists.torproject.org