Skip to content

Commit ad48f2d

Browse files
radarherehugovk
andauthored
Add security release notes (#9741)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 6590b1b commit ad48f2d

2 files changed

Lines changed: 72 additions & 21 deletions

File tree

docs/releasenotes/12.2.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ these checks did not consider integer overflow. This has been corrected.
2525

2626
When parsing a PDF, if a trailer refers to itself, or a more complex cyclic loop
2727
exists, then an infinite loop occurs. Pillow now keeps a record of which trailers it
28-
has already processed. PdfParser was added in Pillow 4.2.0.
28+
has already processed. PdfParser was added in Pillow 5.1.0.
2929

3030
:cve:`2026-42308`: Integer overflow when processing fonts
3131
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

docs/releasenotes/12.3.0.rst

Lines changed: 71 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,84 @@
44
Security
55
========
66

7-
TODO
8-
^^^^
7+
Prevent decompression bomb when parsing PDF
8+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99

10-
TODO
10+
When parsing a PDF, ``PdfStream.decode()`` attempts to decompress data without any
11+
limit. A default maximum of ``ImageFile.SAFEBLOCK`` has been added. ``PdfParser`` was
12+
added in Pillow 5.1.0. Reported by `redyank <https://github.com/redyank>`__.
1113

12-
:cve:`YYYY-XXXXX`: TODO
14+
:cve:`2026-55798`: WindowsViewer.get_command injection
15+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16+
17+
If an attacker has control over the path passed to
18+
``ImageShow.WindowsViewer.get_command()``, and the result is executed by the user, the
19+
attacker may be able to execute arbitrary shell commands. Reported by Bin Luo,
20+
University of Electronic Science and Technology of China (luob87709@gmail.com).
21+
22+
EPS image infinite loop
1323
^^^^^^^^^^^^^^^^^^^^^^^
1424

15-
TODO
25+
If a negative byte count is specified for the BeginBinary byte count, an infinite loop
26+
is possible as Pillow seeks repeatedly backwards. This value will now be validated.
27+
BeginBinary parsing was only added in Pillow 12.0.0. Reported by
28+
`jiagongzheng-stack <https://github.com/jiagongzheng-stack>`__.
29+
30+
JPEG2000 image memory usage
31+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
33+
The total component width was incorrectly accumulated across tiles within a JPEG2000
34+
image, potentially leading to excessive memory use. This was introduced as part of an
35+
earlier security fix in Pillow 8.2.0, but has now been fixed. Reported by Fr3v1.
36+
37+
McIdas out-of-bounds (OOB) read
38+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39+
40+
McIdas images can specify the stride, and if incorrectly set, may cause an OOB read.
41+
This has been fixed. Reported by Devansh Shah, RUDRA Cybersecurity Pvt. Ltd.
1642

17-
Backwards incompatible changes
18-
==============================
43+
Out-of-bounds (OOB) read when saving 1 mode TGA images
44+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1945

20-
TODO
21-
^^^^
46+
Saving 1 mode images as TGA with run-length encoding can trigger an OOB read. This was
47+
added in Pillow 5.2.0, but the functionality is not possible under the TGA
48+
specification, so it has been removed. Reported by
49+
`Seratov <https://github.com/Seratov>`__.
2250

23-
TODO
51+
Out-of-bounds (OOB) write from large RankFilter sizes
52+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53+
54+
:py:class:`~PIL.ImageFilter.RankFilter`, and its subclasses, can potentially write
55+
out-of-bounds if given a large size. This has been fixed. Reported by
56+
`Seratov <https://github.com/Seratov>`__.
57+
58+
Out-of-bounds (OOB) write from ``Image.paste()``
59+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2460

25-
Deprecations
26-
============
61+
Large paste box dimensions can cause an OOB write in ``Image.crop()``,
62+
``Image.paste()`` and ``Image.alpha_composite()``. This has been fixed. Reported by
63+
`Seratov <https://github.com/Seratov>`__.
2764

28-
TODO
29-
^^^^
65+
Out-of-bounds (OOB) write in ``ImageCmsTransform``
66+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3067

31-
TODO
68+
Apply a transform mode to a different image mode can trigger an OOB write in
69+
``ImageCmsTransform``. Errors are now raised if the mode does not match. Reported by
70+
`Seratov <https://github.com/Seratov>`__.
3271

33-
API changes
34-
===========
72+
:cve:`2026-54059`, :cve:`2026-54060`, :cve:`2026-55379`: Prevent FontFile decompression bomb
73+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3574

36-
TODO
37-
^^^^
75+
Decompression bomb checks have now been added to :py:class:`~PIL.FontFile.FontFile`,
76+
and its subclasses, checking the width and height of characters. Reported by Rahul
77+
Singh and Dinesh.
3878

39-
TODO
79+
:cve:`2026-55380`: Prevent GD decompression bomb
80+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81+
82+
A decompression bomb check has been added to :py:class:`~PIL.GdImageFile.GdImageFile`.
83+
This is format must be explicitly called though, rather than being accessible from
84+
``Image.open()``. Reported by Rahul Singh.
4085

4186
API additions
4287
=============
@@ -51,6 +96,12 @@ default, images will be captured at 2x. If ``scale_down`` is ``True``, they will
5196

5297
Previously, macOS screenshots with a ``bbox`` were captured at 1x by default.
5398

99+
Added ``max_length`` argument to ``PdfStream.decode()``
100+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
101+
102+
When calling ``PdfStream.decode()``, the maximum length of data to decode can now be
103+
specified. This will default to ``ImageFile.SAFEBLOCK``.
104+
54105
Other changes
55106
=============
56107

0 commit comments

Comments
 (0)