mirror of https://github.com/OISF/suricata
swf: validate configured depth limits
SWF depth settings were previously limited only to values representable by uint32_t. This is not sufficient for the buffer-size calculations performed during SWF decompression. The decompressed output requires an additional 8-byte FWS header. The inspection buffer also grows by doubling a uint32_t size, so a required buffer larger than 2 GiB can cause the growth calculation to wrap. For LZMA input, a synthesized 13-byte header to the compressed data is used. The configured compressed-data limit must leave room for this header. This patch applies the following upper limits: - decompress-depth: 2147483640 bytes (2 GiB minus the 8-byte FWS header) - compress-depth: 4294967282 bytes (UINT32_MAX minus the 13-byte LZMA header Ticket: #8914pull/16213/head
parent
e707b21e21
commit
ae4341eb5f
Loading…
Reference in New Issue