You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bound wire-declared sizes and decompressed output during parsing
Several parsers that handle client-controlled input trusted sizes
declared on the wire without bounding them, which could make a
connection consume far more memory than the message itself:
- gzip/zlib/snappy decompression had no output cap: -max_body_size
is only checked against the compressed bytes, so a small body
could decompress to tens of GiB. Add -max_decompressed_body_size
(default 32x -max_body_size, 0 means use the default) and enforce
it in all three decompressors.
- AMF string readers resized the output buffer to the declared
length before checking how many bytes were actually available;
read the string in bounded chunks instead.
- RTMP chunk headers may re-declare a message while a previous
message is still being assembled on the same chunk stream. Bound
the declared message length by -max_body_size and drop the stale
partial body when a new message header arrives.
- mcpack2pb trusted the wire-decla- mcpack2pb trusted the wire-decla- mcpack2pb trusted the wire-dected Reserve() c- mcpack2pb trusted the wire-decla- mcpack2pb trusted tand cap the reserved size.
0 commit comments