Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand AEAD limits to consider multi-user security. #3789

Merged
merged 21 commits into from
Sep 1, 2020

Conversation

chris-wood
Copy link
Contributor

@chris-wood chris-wood commented Jun 24, 2020

Closes #3788.

In a typical multi-user setting, the adversary is assumed to perform some
(massive) amount of offline work to break the integrity of a single random
connection. Each user is represented as a unique (key, nonce) pair. In
considering the same threat model, we must treat each key resulting from
a KeyUpdate event as a unique user. As a result, roughly speaking, bounds
implied from the multi-user setting imply (minimally) for the lifetime of
a single connection.

Hoang et al. [1] present tight multi-user security bounds for randomized AES-GCM
(as is used in TLS 1.3 and QUIC), so we can take advantage of those for
per-connection integrity limits. (Confidentiality limits still apply per-key, as
the analysis considers only encrypted blocks, which would not change if an endpoint
updated its key or created a new connection.) In contrast, there are no multi-user
security bounds for AEAD_CHACHA20_POLY1305 or AEAD_AES_128_CCM, so we must use the
single-user bounds in their stead.

[1] https://dl.acm.org/doi/10.1145/3243734.3243816

Christopher Wood added 2 commits June 24, 2020 16:37
In a typical multi-user setting, the adversary is assumed to perform some
(massive) amount of offline work to break the integrity of a single random
connection. Each user is represented as a unique (key, nonce) pair. In
considering the same threat model, we must treat each key resulting from
a KeyUpdate event as a unique user. As a result, roughly speaking, bounds
implied from the multi-user setting imply (minimally) for the lifetime of
a single connection.

Hoang et al. [1] present tight multi-user security bounds for randomized AES-GCM
(as is used in TLS 1.3 and QUIC), so we can take advantage of those for
per-connection integrity limits. (Confidentiality limits still apply per-key, as
the analysis considers only encrypted blocks, which would not change if an endpoint
updated its key or created a new connection.) In contrast, there are no multi-user
security bounds for AEAD_CHACHA20_POLY1305 or AEAD_AES_128_CCM, so we must use the
single-user bounds in their stead.

[1] https://dl.acm.org/doi/10.1145/3243734.3243816
Copy link
Contributor

@janaiyengar janaiyengar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, @chris-wood ! A few comments.

The analyses that follow rely on a count of the number of block operations
involved in producing each message. For simplicity, and to match the analysis of
other AEAD functions in {{AEBounds}}, this analysis assumes a packet length of
2^10 blocks; that is, a packet size limit of 2^14 bytes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this impacts the analysis, but why is packet size 2^14 bytes? For QUIC, I would suggest that 2^11 ought to be adequate (if a larger packet size is more conservative).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided that matching the TLS analysis in this regard is best. Using the larger number is more conservative, so the margins in practice will be better than what we have calculated here.

There is of course the theoretical limit on QUIC packets, which is 2^16 bytes or 2^12 blocks, but as you say, they are mostly much smaller. There is an existing note about this discrepancy for those running a massive MTU.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's the note? Perhaps a pointer to that here would be helpful. Should the integrity/confidentiality limits be made explicit for 2^16-byte packets?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 1588 (on the new side). David raised an issue requesting that we provide limits based on an assumption of 2^16 byte packets. If we do that, we might want to do a split between 2^11 and 2^16 rather than having 2^14. We should track that on that issue though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I'd prefer if we left the 2^16 limits to a separate issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When people say 2^11, do they think 1536 bytes? This is indeed a common packet size. The next interesting size are probably in the "jumbo frame" range -- see for example 9001 bytes mentioned for AWS. That would be 2^14. And then the UDP limit is indeed 2^16.

draft-ietf-quic-tls.md Outdated Show resolved Hide resolved
draft-ietf-quic-tls.md Outdated Show resolved Hide resolved
draft-ietf-quic-tls.md Outdated Show resolved Hide resolved
draft-ietf-quic-tls.md Outdated Show resolved Hide resolved
chris-wood and others added 4 commits June 29, 2020 08:30
Co-authored-by: Jana Iyengar <jri.ietf@gmail.com>
Co-authored-by: Jana Iyengar <jri.ietf@gmail.com>
Co-authored-by: Jana Iyengar <jri.ietf@gmail.com>
Also, split out the integrity limit text again for parallel flow.
draft-ietf-quic-tls.md Outdated Show resolved Hide resolved
this limit. If a key update is not possible, the endpoint MUST immediately
close the connection. Applying a limit reduces the probability that an attacker
is able to successfully forge a packet; see {{AEBounds}} and {{ROBUST}}.
Endpoints MUST count the number of encrypted packets for each set of keys. If
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this clarify who is doing the updating? If I've sent 2^27 or received 2^27 do I initiate?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an existing ambiguity. And the answer is that either endpoint can do the update. As updates are symmetric, this isn't a big deal, but you can stumble over each other if you do it poorly.

I haven't implemented this bit yet, but when I did it for TLS, the sender updates at limit-N and the receiver requests an update at limit-M where M < N. This is because the primary responsibility for the update lies with the sender. This stops endpoints using the same implementation from doing near-simultaneous updates, which is a little wasteful. If M for one implementation matches N for another, then you can still get a race. Of course, QUIC handles simultaneous updates well, so maybe you don't care for that level of sophistication.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll second that. IKEv2 simultaneous key update is so complicated that most configurations I've seen intentionally use different limits on both endpoints to reduce the odds of a simultaneous rekey. In QUIC however, simultaneous rekey has the same complexity as regular rekey so I don't think it's worth working around.

@martinthomson martinthomson added -tls design An issue that affects the design of the protocol; resolution requires consensus. labels Jul 6, 2020
martinthomson and others added 10 commits July 6, 2020 16:57
This corrects an arithmetic error in the calculation of the
confidentiality limit for AES-GCM.

It also changes to using a fixed advantage target of 2^-57 for both
confidentiality and integrity.  The inconsistent use of different limits
was making it hard to reason about.  As the overall target is AE
security, the net effect of this is a factor of 2 improvement in
attacker advantage over what is in the TLS analysis, which was
2^-57+2^-60.  This moves to 2^-56 overall, which is cleaner.

In doing so, I discovered that the integrity limits for both AES-GCM and
AES-CCM were being set independent of the confidentiality limits, but
that the confidentiality limits assumed limits on the number of
forgeries.  As a result, the limits on forgeries had to be capped based
on those assumptions.
@chris-wood
Copy link
Contributor Author

(Thanks, @martinthomson!)

draft-ietf-quic-tls.md Outdated Show resolved Hide resolved
draft-ietf-quic-tls.md Outdated Show resolved Hide resolved
draft-ietf-quic-tls.md Show resolved Hide resolved
draft-ietf-quic-tls.md Outdated Show resolved Hide resolved
2^36 forged packets; see {{AEBounds}}. For AEAD_AES_128_CCM, the integrity limit
is 2^23.5 forged packets; see {{ccm-bounds}}. Applying this limit reduces the
probability that an attacker can successfully forge a packet; see {{AEBounds}},
{{ROBUST}}, and {{?GCM-MU}}.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I wouldn't use "forged" here but rather "invalid". We don't know why they are invalid.

Copy link
Contributor

@DavidSchinazi DavidSchinazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I think this is ready to merge. I left some small editorial nits

this limit. If a key update is not possible, the endpoint MUST immediately
close the connection. Applying a limit reduces the probability that an attacker
is able to successfully forge a packet; see {{AEBounds}} and {{ROBUST}}.
Endpoints MUST count the number of encrypted packets for each set of keys. If
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll second that. IKEv2 simultaneous key update is so complicated that most configurations I've seen intentionally use different limits on both endpoints to reduce the odds of a simultaneous rekey. In QUIC however, simultaneous rekey has the same complexity as regular rekey so I don't think it's worth working around.

draft-ietf-quic-tls.md Show resolved Hide resolved
draft-ietf-quic-tls.md Outdated Show resolved Hide resolved
draft-ietf-quic-tls.md Outdated Show resolved Hide resolved
@martinthomson martinthomson merged commit 71a1ff2 into quicwg:master Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-tls design An issue that affects the design of the protocol; resolution requires consensus.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New confidentiality and integrity limits
7 participants