Subject: Entropy in headers for connection identification at a stateful firewall

From: Töma Gavrichenkov <[email-masked]>
Date: Tue, 6 Nov 2018 15:39:11 +0700

Hello WG,

Consider, please, the following use case in your spare time:

An access network (to simplify things) doesn't host any listening
ports but rather just provides access to individual users. Some of the
users, or the network itself, have DDoS attacks in their threat model.
To address that, the network deploys a stateful firewall on or close
to its border, far away from the last mile that could get congested.

The said firewall doesn't allow incoming traffic towards the user
machines, except for the packets belonging to connections initiated
from the inside.

For the sake of simplicity, let's treat the bandwidth on the border
and computational resources of the firewall to be sufficient for
processing any incoming traffic.

With the Internet transport protocols of 1970s, one of the possible
attack scenarios would then be to generate a large number of packers
per second with a 5-tuple equal to a connection already existing on
the firewall. In real life scenarios, an off-path attacker already
knows 4 of 5-tuple parameters and just needs to guess the source port
number a client has chosen to connect. The entropy is then generally
limited to just 15 bits, which is believed to be not enough for proper
protection of long-living sessions given the attack bandwidth levels
observed today.

In theory, the attacker also needs a side channel to figure out
whether or not they have guessed the port already. In practice, the
attacker usually does have such a side channel. E.g. during an online
gaming tournament if one of the competing players experiences a
connectivity problem it almost immediately becomes obvious for anyone.

However, with TCP, we have SEQ and ACK numbers, which both add greatly
to the entropy of a 5-tuple. (And, yes, in reality you cannot rely on
proper SEQ randomness of a network client or server, but that's
another story).

The issue might be UDP, but in practice either the UDP "session" is
expected to be very short-lived (DNS, NTP, etc.), or the protocol is
not mission critical, or the protocol exposes a stable part in the
layer 7 header which could also be used for reliable connection
tracking. You'll have, however, to implement specific modules for each
such a protocol. (In fact, the rest of the protocols you don't know
what to do with could then just go through a fixed pipe with a
bandwidth rate limit much below anything that you might have at the
last mile.)

What I was going to ask for is an advice on how could such a threat
model be addressed if a client connects to a QUIC server. My first
intention was to write down connection IDs, but it turns out those may
change at will. The rest of the (long, let alone short) header is
fixed.

(I'm also present onsite in BKK, if that's easier for someone to ask
for any clarifications or explanations this way)

Thanks,

| Töma Gavrichenkov
| gpg: 2deb 97b1 0a3c 151d b67f 1ee5 00e7 94bc 4d08 9191
| mailto: [email-masked]
| fb: ximaera
| telegram: xima_era
| skype: xima_era
| tel. no: +7 916 515 49 58

---

From: Mikkel Fahnøe Jørgensen <[email-masked]>
Date: Tue, 6 Nov 2018 01:08:43 -0800

Hi Töma

there is not much hope for the scenario you describe unless your firewall
cooperates with the endpoints on how the connection ID is generated.

QUIC actively seeks to prevent middleboxes from having insight into the
packet context for privacy reasons and to prevent ossifications (such as
one of your modules stop working on next QUIC version upgrade). You cannot
verify if a connection ID is valid without additional context.

QUIC allows for multiple connections on the same 5-tuple even if they
belong to different users with respect to access permissions.

The solution is to create an algorithm for the connection ID. This is
discussed in the QUIC draft but it only discusses servers. Server
coordination with firewalls are relatively easy because an organisation can
deploy those together. A connection ID can have a signature or pattern
known only to these deployments.

In your scenario you want to protect traffic towards the client (the user).
Typically clients cannot easily coordinate with a firewall. It would
technically be possible if the client sort of signed in with the
infrastructure, but the QUIC implemention needs to be aware and this most
likely forces a specific QUIC version and implementation.

If a middlebox experience excessive load on some 5-tuples or connection
ID’s it can issue a RETRY on new connections. If a client gives up a
connection due to timeouts etc. it might try to create a new connection.
This new connection might land on the same problematic middlebox. This
middlebox then issues a RETRY that informs the client to try to connect to
another server which hopefully lands it a on path that is not subject to
attack. A RETRY only has one level, so if the new location is also under
attack, the client must abort the connection attempt altogether and start
over from scratch. It might then get lucky for example by choosing a random
IP from a DNS record.

hope this helps
Mikkel

On 6 November 2018 at 09.39.44, Töma Gavrichenkov ([email-masked]) wrote:

Hello WG,

Thanks,

| Töma Gavrichenkov

---

From: Mikkel Fahnøe Jørgensen <[email-masked]>
Date: Tue, 6 Nov 2018 01:16:01 -0800

I forgot to mention that in the case of a second RETRY, the client would
likely not start over but rather attempt to stick with the last attempt.
The middelbox RETRY will then be ignored. We recent had a discussion on
whether to drop or abort in this case - usually drop is the best action to
prevent abuse, but I’m not sure it is in all cases. Either way, the
connection setup is always vulnerable to attacks and QUIC does not presume
to be able to prevent all of these - it only picks low hanging fruits. Once
the handshake is in progress, it becomes much harder to interfere with the
connection (for both evil and well meaning devices).

Mikkel

On 6 November 2018 at 10.08.43, Mikkel Fahnøe Jørgensen ([email-masked])
wrote:

Hi Töma

hope this helps
Mikkel

Hello WG,

Thanks,

| Töma Gavrichenkov

---

From: Töma Gavrichenkov <[email-masked]>
Date: Tue, 6 Nov 2018 16:22:27 +0700

Hi Mikkel,

Thank you for your input,

> If a middlebox experience excessive load on some 5-tuples or connection ID’s it can issue a RETRY on new connections. If a client gives up a connection due to timeouts etc. it might try to create a new connection. This new connection might land on the same problematic middlebox. This middlebox then issues a RETRY that informs the client to try to connect to another server which hopefully lands it a on path that is not subject to attack. A RETRY only has one level, so if the new location is also under attack, the client must abort the connection attempt altogether and start over from scratch. It might then get lucky for example by choosing a random IP from a DNS record.

Well, like I said, there wouldn't be any problem with the middlebox,
it would be able to handle virtually any possible load. It's the
client who wouldn't.

RETRYing on connection is something I also thought of, but in case of
latency- and jitter-specific applications (AV streaming, gaming, etc.)
a constant connection retry could actually be an attacker's purpose.

As a side note, usually we don't have any control on either the client
or, especially, the server. We don't know if it deploys one IP address
to DNS or more. In theory, a solution might be to set up a proxy on
the path, but in reality it's too complicated and, ironically, would
severily harm the user's privacy.

---

From: Mikkel Fahnøe Jørgensen <[email-masked]>
Date: Tue, 6 Nov 2018 01:25:53 -0800

On 6 November 2018 at 10.22.40, Töma Gavrichenkov ([email-masked]) wrote:

That is also what I meant: the middlebox could observe excess load on a
specific 3- or 5- tuple without itself being overloaded.

---

From: Töma Gavrichenkov <[email-masked]>
Date: Tue, 6 Nov 2018 16:37:47 +0700

On Tue, Nov 6, 2018 at 4:25 PM Mikkel Fahnøe Jørgensen
<[email-masked]> wrote:
> That is also what I meant: the middlebox could observe excess load on a specific 3- or 5- tuple without itself being overloaded.

Ah. Yes, this way changing to a new 5-tuple will help for some period
of time, though it makes QUIC a poor choice for e.g. video streaming
then :-(

> QUIC allows for multiple connections on the same 5-tuple

Well, sorry, this is up to the terminology. The purpose is just to
make sure an incoming packet is in fact a response to something
outgoing in the past. How many connections or streams go through those
packets is out of scope of the problem.