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

[SECURITY] aioquic may store an unlimited number of remote path challenges #544

Open
AsakuraMizu opened this issue Sep 5, 2024 · 1 comment

Comments

@AsakuraMizu
Copy link

AsakuraMizu commented Sep 5, 2024

Summary

aioquic may infinitely receive PATH_CHALLENGE frames and store challenge data in remote_challenges, resulting in unbounded memory usage. It may lead to a denial-of-service attack.

Tested Version

Latest git commit (9bc1e43)

Details

#483 appears to be the cause of this vulnerability. Although MAX_REMOTE_CHALLENGES is defined, the constant is not used. As a result, the remote_challenges queue can grow infinitely.

Suggestion

context.network_path.remote_challenges.append(data)

Check the length of remote_challenges before appending challenge data.

@k4ra5u
Copy link

k4ra5u commented Oct 25, 2024

This issue is verified to be reproducible, by constantly writing path challenge frames, aioquic has consumed almost 10GB of memory and will eventually be killed by the OS.

while len(network_path.remote_challenges) > 0:
challenge = network_path.remote_challenges.popleft()

Although connection.py's line 3041 empties network_path.remote_challenges, however, if the client chooses not to send an ACK message in response to the path response, aioquic does not go as far as this statement, causing the network_path.remote_challengesqueue to continue to accumulate.
poc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants