What did you do?
Generated a CVE-2023-4863 POC image, and attempted to open it with Pillow 10.0.1:
curl -O https://raw.githubusercontent.com/mistymntncop/CVE-2023-4863/main/craft.c
gcc -o craft ./craft.c
./craft bad.webp
>>> from PIL import Image
>>> Image.open('/tmp/bad.webp')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/alienth/venv/lib/python3.10/site-packages/PIL/Image.py", line 3264, in open
im = _open_core(
File "/home/alienth/venv/lib/python3.10/site-packages/PIL/Image.py", line 3245, in _open_core
im = factory(fp, filename)
File "/home/alienth/venv/lib/python3.10/site-packages/PIL/ImageFile.py", line 117, in __init__
self._open()
File "/home/alienth/venv/lib/python3.10/site-packages/PIL/WebPImagePlugin.py", line 62, in _open
self._decoder = _webp.WebPAnimDecoder(self.fp.read())
OSError: could not create decoder object
>>> Image.__version__
'10.0.1'
What did you expect to happen?
Some more accurate exception to be thrown, such as PIL.UnidentifiedImageError.
What actually happened?
OSError thrown when trying to create Animation decoder.
What are your OS, Python and Pillow versions?
- OS: Ubuntu Jammy
- Python: 3.10.12
- Pillow: 10.0.1
from PIL import Image
Image.open('/tmp/bad.webp')
What did you do?
Generated a CVE-2023-4863 POC image, and attempted to open it with Pillow 10.0.1:
>>> from PIL import Image >>> Image.open('/tmp/bad.webp') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/alienth/venv/lib/python3.10/site-packages/PIL/Image.py", line 3264, in open im = _open_core( File "/home/alienth/venv/lib/python3.10/site-packages/PIL/Image.py", line 3245, in _open_core im = factory(fp, filename) File "/home/alienth/venv/lib/python3.10/site-packages/PIL/ImageFile.py", line 117, in __init__ self._open() File "/home/alienth/venv/lib/python3.10/site-packages/PIL/WebPImagePlugin.py", line 62, in _open self._decoder = _webp.WebPAnimDecoder(self.fp.read()) OSError: could not create decoder object >>> Image.__version__ '10.0.1'What did you expect to happen?
Some more accurate exception to be thrown, such as
PIL.UnidentifiedImageError.What actually happened?
OSErrorthrown when trying to create Animation decoder.What are your OS, Python and Pillow versions?