|
1 | 1 | 10.2.0
|
2 | 2 | ------
|
3 | 3 |
|
| 4 | +Security |
| 5 | +======== |
| 6 | + |
| 7 | +ImageFont.getmask: Applied ImageFont.MAX_STRING_LENGTH |
| 8 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 9 | + |
| 10 | +To protect against potential DOS attacks when using arbitrary strings as text input, |
| 11 | +Pillow will now raise a :py:exc:`ValueError` if the number of characters passed into |
| 12 | +:py:meth:`PIL.ImageFont.ImageFont.getmask` is over a certain limit, |
| 13 | +:py:data:`PIL.ImageFont.MAX_STRING_LENGTH`. |
| 14 | + |
| 15 | +This threshold can be changed by setting :py:data:`PIL.ImageFont.MAX_STRING_LENGTH`. It |
| 16 | +can be disabled by setting ``ImageFont.MAX_STRING_LENGTH = None``. |
| 17 | + |
| 18 | +A decompression bomb check has also been added to |
| 19 | +:py:meth:`PIL.ImageFont.ImageFont.getmask`. |
| 20 | + |
| 21 | +ImageFont.getmask: Trim glyph size |
| 22 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 23 | + |
| 24 | +To protect against potential DOS attacks when using PIL fonts, |
| 25 | +:py:class:`PIL.ImageFont.ImageFont` now trims the size of individual glyphs so that |
| 26 | +they do not extend beyond the bitmap image. |
| 27 | + |
| 28 | +Fix CVE-2023-50447 |
| 29 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 30 | + |
| 31 | +ImageMath.eval: Restricted environment keys. |
| 32 | + |
| 33 | +.. note:: More information about this vulnerability included in database record :cve:`2023-50447` |
| 34 | + |
| 35 | +If an attacker has control over the keys passed to the |
| 36 | +``environment`` argument of :py:meth:`PIL.ImageMath.eval`, they may be able to execute |
| 37 | +arbitrary code. To prevent this, keys matching the names of builtins and keys |
| 38 | +containing double underscores will now raise a :py:exc:`ValueError`. |
| 39 | + |
4 | 40 | Deprecations
|
5 | 41 | ============
|
6 | 42 |
|
@@ -63,38 +99,6 @@ JPEG tables-only streamtype
|
63 | 99 | When saving JPEG files, ``streamtype`` can now be set to 1, for tables-only. This will
|
64 | 100 | output only the quantization and Huffman tables for the image.
|
65 | 101 |
|
66 |
| -Security |
67 |
| -======== |
68 |
| - |
69 |
| -ImageFont.getmask: Applied ImageFont.MAX_STRING_LENGTH |
70 |
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
71 |
| - |
72 |
| -To protect against potential DOS attacks when using arbitrary strings as text input, |
73 |
| -Pillow will now raise a :py:exc:`ValueError` if the number of characters passed into |
74 |
| -:py:meth:`PIL.ImageFont.ImageFont.getmask` is over a certain limit, |
75 |
| -:py:data:`PIL.ImageFont.MAX_STRING_LENGTH`. |
76 |
| - |
77 |
| -This threshold can be changed by setting :py:data:`PIL.ImageFont.MAX_STRING_LENGTH`. It |
78 |
| -can be disabled by setting ``ImageFont.MAX_STRING_LENGTH = None``. |
79 |
| - |
80 |
| -A decompression bomb check has also been added to |
81 |
| -:py:meth:`PIL.ImageFont.ImageFont.getmask`. |
82 |
| - |
83 |
| -ImageFont.getmask: Trim glyph size |
84 |
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
85 |
| - |
86 |
| -To protect against potential DOS attacks when using PIL fonts, |
87 |
| -:py:class:`PIL.ImageFont.ImageFont` now trims the size of individual glyphs so that |
88 |
| -they do not extend beyond the bitmap image. |
89 |
| - |
90 |
| -ImageMath.eval: Restricted environment keys |
91 |
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
92 |
| - |
93 |
| -:cve:`2023-50447`: If an attacker has control over the keys passed to the |
94 |
| -``environment`` argument of :py:meth:`PIL.ImageMath.eval`, they may be able to execute |
95 |
| -arbitrary code. To prevent this, keys matching the names of builtins and keys |
96 |
| -containing double underscores will now raise a :py:exc:`ValueError`. |
97 |
| - |
98 | 102 | Other Changes
|
99 | 103 | =============
|
100 | 104 |
|
|
0 commit comments