mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-22 13:14:45 +03:00
Moved CVE images into password-protected zip
This commit is contained in:
parent
8deaebd5e0
commit
4354fa5402
|
@ -14,15 +14,25 @@
|
|||
# version.
|
||||
|
||||
|
||||
import io
|
||||
import zipfile
|
||||
|
||||
from PIL import Image
|
||||
|
||||
# The vulnerabilities represented by these files have been addressed.
|
||||
# However, antivirus software does not detect that this is a version of Pillow
|
||||
# with those fixes, and so to prevent unnecessary alarm, the files are
|
||||
# hidden inside a password-protected zip
|
||||
repro_read_strip = (
|
||||
"images/crash_1.tif",
|
||||
"images/crash_2.tif",
|
||||
"crash_1.tif",
|
||||
"crash_2.tif",
|
||||
)
|
||||
|
||||
with zipfile.ZipFile("images/crash.zip") as crashzip:
|
||||
for path in repro_read_strip:
|
||||
with Image.open(path) as im:
|
||||
with crashzip.open(path, pwd=b"vulnerabilitiesaddressed") as f:
|
||||
data = io.BytesIO(f.read())
|
||||
with Image.open(data) as im:
|
||||
try:
|
||||
im.load()
|
||||
except Exception as msg:
|
||||
|
|
BIN
Tests/images/crash.zip
Normal file
BIN
Tests/images/crash.zip
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user