Repository navigation
Conversation
Buffered reads through hackney_conn (the default body read, body/1) had no size limit on any protocol, so a server sending an endless body could exhaust memory. Only the direct hackney_h3 API was capped (GHSA-jq4m). The same 512 MiB default now applies everywhere, per request through max_body_size. HTTP/2 and HTTP/3 cancel just the stream, HTTP/1.1 closes the connection. Skipping a redirect body no longer buffers it.
Owner
Author
|
Closing in favour of #980. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Buffered body reads on the main API (the default
hackney:requestbody,body/1) appended every chunk with no size limit on HTTP/1.1, HTTP/2 and HTTP/3. A server that keeps sending a body, slowly enough to stay insiderecv_timeout, could grow the connection process until the node ran out of memory. Only the directhackney_h3API had a cap (GHSA-jq4m).There is now a
max_body_sizerequest option, default 512 MiB (same ashackney_h3),infinityto disable. Past the cap the read returns{error, body_too_large}: HTTP/2 and HTTP/3 cancel only that stream and keep the connection, HTTP/1.1 closes it. Skipping a redirect body now drains without buffering. Streaming and async reads are unchanged.Behaviour change: buffered downloads above 512 MiB now fail unless
max_body_sizeis raised.Reported by manus-pi (GHSA-pph4-mwcc-w6v2).