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

Cache timing warning #1225

Closed
ekr opened this issue Mar 16, 2021 · 5 comments
Closed

Cache timing warning #1225

ekr opened this issue Mar 16, 2021 · 5 comments
Assignees

Comments

@ekr
Copy link
Contributor

ekr commented Mar 16, 2021

Ben Schwartz writes:

RFC8446 (and bis) currently describe a "cache timing" attack on use of Early Data:

  • Exploiting cache timing behavior to discover the content of 0-RTT
    messages by replaying a 0-RTT message to a different cache node
    and then using a separate connection to measure request latency,
    to see if the two requests address the same resource.

In fact, many users of TLS (e.g. HTTPS, DNS-over-TLS) are even more vulnerable to cache-based attacks:

  • The attacker can probe the cache without triggering a cache fill (Cache-Control: only-if-cached, RD=0)
  • The attacker can observe the remaining cache lifetime, which indicates when cache fill occurred (coincident with the > replay or not), and when a resource will expire out of the cache (best time to try the attack).

I think we should probably broaden the attack description. e.g.

 *  Exploiting cache behavior to discover the content of 0-RTT messages
    by locating a cache node that does not have a resource of interest
   cached, replaying a 0-RTT message to it, and then using a separate
    connection to check if the resource was added to the cache.

I also wonder if we should strengthen the advice about replay defenses.

@davidben
Copy link
Contributor

davidben commented Mar 16, 2021

This isn't strictly specific to 0-RTT. A network attacker can already direct the client's connection to any one cache node and then observe side effects. The main thing enabled by replayability is trying the attack multiple times (up to allowed ticket_age skew) for more reliable signal.

@bemasc
Copy link
Contributor

bemasc commented Mar 16, 2021

True, and worth clarifying. A really strong network attacker could even prevent all other access to that cache node, likely giving them several minutes to enumerate different resources, looking for the one the user requested before it expires.

@davidben
Copy link
Contributor

I guess, conversely, a weak network attacker that can see the traffic, but not interfere with it, might not be able to redirect the client's connection, but 0-RTT would enable them to replay it elsewhere.

bemasc pushed a commit to bemasc/tls13-spec that referenced this issue Oct 21, 2022
This attack is often possible even without a timing
channel due to application-layer behaviors that allow
cache probing (e.g. in HTTP and DNS).

This change addresses the original concern in tlswg#1225.
A more thorough revamp of the anti-replay and side channel
recommendations might be needed to address all the
questions raised there.
@ekr
Copy link
Contributor Author

ekr commented Oct 21, 2022

We're looking at incremental change here. @davidben do you have anything you want to add?

@davidben
Copy link
Contributor

I think past-me was just noting this isn't really 0-RTT-specific. If a user's request has side effects you can observe later, you inherently can observe them. And if those side effects are more interesting if you target a particular server instance you use, a network attacker can always direct you traffic there. From what I can see, what's specific to 0-RTT is just:

  • Less capable network attackers may be able to mount this attack. (Redirecting traffic requires some ability to intercept traffic, while just replaying an extra copy only requires you to observe it.)
  • 0-RTT replay allows you to repeat the attack on the same input, which might refine any probabilistic aspects of the attack.

Not sure what implications this has on text. Perhaps something like...

  • Amplifying existing information leaks caused by side effects like
    caching. An attacker could learn information about the content of a
    0-RTT message by replaying it to some cache node that has not cached
    some resource of interest, and then using a separate connection to check
    whether that resource has been added to the cache. This could be repeated
    with different cache nodes as often as the 0-RTT message is replayable.

ekr added a commit to ekr/tls13-spec that referenced this issue Oct 21, 2022
@ekr ekr closed this as completed in a6a6548 Oct 24, 2022
ekr added a commit that referenced this issue Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants