operator/pkg/util: Curious about Adding a Data Limit Check in ioCopyN
?
#5668
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
ioCopyN
?
#5668
Description
Currently, the
ioCopyN
function does not enforce a limit on the amount of data it processes from thetar.Reader
. This can lead to potential Denial of Service (DoS) vulnerabilities through decompression bombs, where maliciously crafted tar files could cause excessive resource consumption.karmada/operator/pkg/util/util.go
Lines 155 to 166 in 6e41d9b
Proposed Changes
Implement a data limit check in the
ioCopyN
function to prevent excessive data processing. This can be achieved by adding the following code to track the total number of bytes written and enforce a maximum size limit:What do you think ? 🤔
The text was updated successfully, but these errors were encountered: