Highlights
Denial of Service: 3 prior fixes. Scrutinize any change in this area.
torchvision/csrc/io/image/cpu/decode_webp.cpp: most-fixed (2 issues). Treat as high-risk during review.
1 high-severity fix in this history; regressions here are high-impact.
Recurring patterns
The bug types that recur here, drawn from past fixes, not open vulnerabilities.
Memory Safety: Insufficent validation of input stream sizes prior to processing headers can lead to heap out-of-bounds reads and memory corruption when calling third-party image libraries like libpng. Ensure all decoding logic rigorously validates minimum input headers before invoking library routines.
Denial of Service: Decoding libraries allocating buffers on the heap that are subsequently converted to PyTorch Tensors must associate custom deleters (e.g., using WebPFree) with the tensor's lifecycle to prevent memory leaks and eventual system-wide denial of service.
Integer Overflow: Calculating buffer allocation sizes for multi-gigabyte video or image tensors using standard 32-bit integers can result in wrap-around overflows. This causes undersized buffer allocations followed by memory corruption when populated. Calculations must be cast to 64-bit size_t/int64_t types.