Skip to content

cap decompressed payload size in rocket MaybeDecompress - #728

Open
itecz26 wants to merge 1 commit into
meta:mainfrom
itecz26:go-rocket-decompress-cap
Open

itecz26 wants to merge 1 commit into
meta:mainfrom
itecz26:go-rocket-decompress-cap

Conversation

@itecz26

@itecz26 itecz26 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

MaybeDecompress runs on every rocket request before method lookup, and decompressZstd's DecodeAll trusts the frame header's declared content size, so a 17-byte zstd frame claiming 60 GiB makes the server allocate 60 GiB up front (a fatal Go runtime OOM on most hosts) while zlib output is unbounded; cap zstd, zlib and lz4 output at maxDecompressedSize, the header transport's MaxFrameSize.

@meta-cla meta-cla Bot added the CLA Signed label Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant