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

Avoid race condition with peer in server path secret map read #2314

Open
Mark-Simulacrum opened this issue Sep 3, 2024 · 1 comment
Open
Labels
priority/high Rank 2 scope/dc Related to s2n-quic-dc size/small

Comments

@Mark-Simulacrum
Copy link
Collaborator

Security issue notifications

If you discover a potential security issue in s2n-quic we ask that you notify
AWS Security via our vulnerability reporting page. Please do not create a public github issue.

Problem:

Currently a sequence like:

  • Client starts + finishes handshake for secret A
  • Client starts handshake for secret B
  • Client sends a datagram packet, encrypted with A
  • Server receives on_peer_stateless_reset_tokens, inserts B into the path secret map
  • Server looks up IP, gets B, encrypts + replies
  • Client looks up path secret B and fails since handshake for B is not yet complete

Solution:

We need to delay the insertion into the peer set (i.e. by-ip index) on the server until the handshake is fully complete (and so the client is able to decrypt that IP). That probably involves changes to the dc::Endpoint trait to communicate that new state.

Requirements / Acceptance Criteria:

n/a

Out of scope:

  • Removing an entry if the client fails to confirm the handshake.
  • Race conditions that still cause the same sequence to occur, with the client confirming the handshake after completing a separate handshake. This is probably most likely with a delayed packet and a restarting client.
    • If possible we should cover this too, but it's probably hard or impossible.
@Mark-Simulacrum Mark-Simulacrum changed the title Describe the issue Avoid race condition with peer in server path secret map read Sep 3, 2024
@dougch
Copy link
Contributor

dougch commented Sep 11, 2024

Thanks for the issue, we'll have a look.

@WesleyRosenblum WesleyRosenblum added scope/dc Related to s2n-quic-dc priority/high Rank 2 size/small labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/high Rank 2 scope/dc Related to s2n-quic-dc size/small
Projects
None yet
Development

No branches or pull requests

3 participants