BIT-python-2024-8088: Infinite loop when iterating over zip archive entry names from zipfile.Path
There is a HIGH severity vulnerability affecting the CPython "zipfile" module affecting "zipfile.Path". Note that the more common API "zipfile.ZipFile" class is unaffected.
When iterating over names of entries in a zip archive (for example, methods of "zipfile.Path" like "namelist()", "iterdir()", etc) the process can be put into an infinite loop with a maliciously crafted zip archive. This defect applies when reading only metadata or extracting the contents of the zip archive. Programs that are not handling user-controlled zip archives are not affected.
Affected Software
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using zipfile.Path to enumerate archive entry names, including through methods such as namelist() or iterdir(), are exposed if they process user-controlled ZIP archives. Code using the more common zipfile.ZipFile API is unaffected, and applications that do not handle user-controlled archives are not affected.
What must an attacker provide to trigger the issue?
An attacker must supply a maliciously crafted ZIP archive that the application processes through zipfile.Path. The issue can be triggered while reading archive metadata or while extracting archive contents.
What is the impact of successful exploitation?
Processing the crafted archive can cause the affected process to enter an infinite loop, resulting in loss of availability for that process.