CVE-2024-28122: Golang Unbounded Decompression Readall

Reading the entirety of a compressed data stream using `ioutil.ReadAll` or `io.ReadAll` can lead to a Denial of Service (DoS) vulnerability due to unbounded memory allocation (e.g., zip bomb attack). Instead, constrain the maximum expected decompressed size by using `io.LimitReader` combined with `ReadAll`, or loop manually over `Read` checks verifying paylo

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Go
greprules fetch cve-2024-28122-golang-unbounded-decompression-readall --engine opengrep

Description

Reading the entirety of a compressed data stream using `ioutil.ReadAll` or `io.ReadAll` can lead to a Denial of Service (DoS) vulnerability due to unbounded memory allocation (e.g., zip bomb attack). Instead, constrain the maximum expected decompressed size by using `io.LimitReader` combined with `ReadAll`, or loop manually over `Read` checks verifying paylo