File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change 1- Improve Zip file validation in :func: `zipfile.is_zipfile `.
2-
3- Before this change :func: `zipfile.is_zipfile ` only checked the End Central Directory
4- signature. If the signature could be found in the last 64k of the file,
5- success! This produced false positives on any file with ``'PK\x05\x06' `` in the
6- last 64k of the file - including PDFs and PNGs.
7-
8- This is now corrected by actually validating the Central Directory location
9- and size based on the information provided by the End of Central Directory
10- along with verifying the Central Directory signature of the first entry.
11-
12- This should be sufficient for the vast number of Zip files with fewer
13- false positives.
1+ Improve Zip file validation false positive rate in :func: `zipfile.is_zipfile `.
You can’t perform that action at this time.
0 commit comments