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

read_unordered can issue redundant flow control credit #735

Closed
Ralith opened this issue Apr 29, 2020 · 0 comments · Fixed by #758
Closed

read_unordered can issue redundant flow control credit #735

Ralith opened this issue Apr 29, 2020 · 0 comments · Fixed by #758
Labels
bug Something isn't working

Comments

@Ralith
Copy link
Collaborator

Ralith commented Apr 29, 2020

Stream assembly only deduplicates buffered data when the number of buffered frames exceeds a critical threshold. Because read_unordered pulls frames directly out of the buffer and does not keep track of previously-read data, receiving the same stream frame multiple times can lead to arbitrarily large increases in flow control limits. A malicious or buggy peer could leverage this to perform a memory-exhaustion DoS on an application that uses read_unordered.

One approach for a fix is to maintain a RangeSet defining which portions of the stream have not yet been read when using unordered reads, just as the assembler's offset defines that for ordered reads. Redundant data could then be discarded for both flow control and application processing purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant