File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- Improve zipfile validation in `zipfile.is_zipfile `.
1+ Improve Zip file validation in :func: `zipfile.is_zipfile `.
22
3- Before this change `zipfile.is_zipfile() ` only checked the End Central Directory
3+ Before this change :func: `zipfile.is_zipfile ` only checked the End Central Directory
44signature. 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
5+ success! This produced false positives on any file with `` 'PK\x05\x06' ` ` in the
66last 64k of the file - including PDFs and PNGs.
77
88This is now corrected by actually validating the Central Directory location
9- and size based on the information provided by the End Central Directory
9+ and size based on the information provided by the End of Central Directory
1010along with verifying the Central Directory signature of the first entry.
1111
12- This should be sufficient for the vast number of zipfiles with fewer
12+ This should be sufficient for the vast number of Zip files with fewer
1313false positives.
You can’t perform that action at this time.
0 commit comments