Bug 29002 - python-pillow new security issues CVE-2021-2528[7-9], CVE-2021-2529[0-3], CVE-2021-2792[1-3], CVE-2021-2867[5-8], CVE-2021-34552
Summary: python-pillow new security issues CVE-2021-2528[7-9], CVE-2021-2529[0-3], CVE...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal critical
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL:
Whiteboard: MGA8-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks: 28137
  Show dependency treegraph
 
Reported: 2021-05-29 00:36 CEST by David Walser
Modified: 2021-08-06 11:35 CEST (History)
6 users (show)

See Also:
Source RPM: python-pillow-8.1.2-1.mga9.src.rpm
CVE:
Status comment:


Attachments
PIL image conversion (494 bytes, text/plain)
2021-08-03 16:57 CEST, Len Lawrence
Details
Convert images to PNG format. (453 bytes, text/x-python3)
2021-08-03 16:59 CEST, Len Lawrence
Details

Description David Walser 2021-05-29 00:36:38 CEST
Ubuntu has issued advisories on March 11 and May 19:
https://ubuntu.com/security/notices/USN-4763-1
https://ubuntu.com/security/notices/USN-4963-1

The issues are fixed upstream in 8.2.0.

Mageia 7 and Mageia 8 are also affected.
David Walser 2021-05-29 00:36:57 CEST

Whiteboard: (none) => MGA8TOO, MGA7TOO
Status comment: (none) => Fixed upstream in 8.2.0
Blocks: (none) => 28137

Comment 1 David Walser 2021-05-29 18:27:36 CEST
Fedora has issued an advisory for some of these issues on March 15:
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/ZTSY25UJU7NJUFHH3HWT575LT4TDFWBZ/
Comment 2 Lewis Smith 2021-05-29 20:31:55 CEST
Assigning to the Python people; CC'ing Philippe (registered maintainer).

CC: (none) => makowski.mageia
Assignee: bugsquad => python

Comment 3 David Walser 2021-05-31 01:13:31 CEST
Fedora has issued an advisory for more of these issues today (May 30):
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/3LXQLR356JK5OP4XVQ7R6K53WQUYMVAN/
Comment 4 David Walser 2021-07-01 18:54:21 CEST
Removing Mageia 7 from whiteboard due to EOL:
https://blog.mageia.org/en/2021/06/08/mageia-7-will-reach-end-of-support-on-30th-of-june-the-king-is-dead-long-live-the-king/

Whiteboard: MGA8TOO, MGA7TOO => MGA8TOO

Comment 5 David Walser 2021-07-23 21:50:17 CEST
Debian-LTS has issued an advisory on July 22:
https://www.debian.org/lts/security/2021/dla-2716

The newest CVE is fixed upstream in 8.3.0:
https://pillow.readthedocs.io/en/stable/releasenotes/8.3.0.html#buffer-overflow

Status comment: Fixed upstream in 8.2.0 => Fixed upstream in 8.3.0
Severity: major => critical
Summary: python-pillow new security issues CVE-2021-2528[7-9], CVE-2021-2529[0-3], CVE-2021-2792[1-3], CVE-2021-2867[5-8] => python-pillow new security issues CVE-2021-2528[7-9], CVE-2021-2529[0-3], CVE-2021-2792[1-3], CVE-2021-2867[5-8], CVE-2021-34552

Comment 6 Nicolas Lécureuil 2021-07-31 23:19:11 CEST
CVE-2021-2529[0-3] is already fixed in pillow 8.1.1

CC: (none) => mageia

Comment 7 Nicolas Lécureuil 2021-07-31 23:20:10 CEST
CVE-2021-2792[1-3] is fixed in 8.1.2
Comment 8 Nicolas Lécureuil 2021-08-01 01:04:56 CEST
Fixed in mga8/9:


src:
    - python-pillow-8.1.2-1.mga8


CVE Fixed in the update:
CVE-2021-25287,CVE-2021-25288, CVE-2021-28675, CVE-2021-28676, CVE-2021-28677; CVE-2021-28678, CVE-2021-34552

Status comment: Fixed upstream in 8.3.0 => (none)
Version: Cauldron => 8
Whiteboard: MGA8TOO => (none)
Assignee: python => qa-bugs

Comment 9 David Walser 2021-08-01 01:34:00 CEST
python3-pillow-tk-8.1.2-1.mga8
python3-pillow-devel-8.1.2-1.mga8
python3-pillow-8.1.2-1.mga8
python3-pillow-qt-8.1.2-1.mga8
python3-pillow-doc-8.1.2-1.mga8

from python-pillow-8.1.2-1.mga8.src.rpm
Comment 10 David Walser 2021-08-02 17:05:00 CEST
Fedora advisory for CVE-2021-34552 (from today, August 2):
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/OVZ5XXNB4NVJY7STDRPWCTFK7LCEA7JR/
Comment 11 Len Lawrence 2021-08-03 16:57:04 CEST
Created attachment 12885 [details]
PIL image conversion

Make script executable first then:
$ ./convertx file1.png file2.tif file3.pcx .....
Generates JPEG output files.

CC: (none) => tarazed25

Comment 12 Len Lawrence 2021-08-03 16:59:09 CEST
Created attachment 12886 [details]
Convert images to PNG format.

$ ./convertz file1.jpg file2.tif ....
Comment 13 Herman Viaene 2021-08-03 17:22:40 CEST
MGA8-64 Plasma on Lenovo B50
No installation issues
Ref bug 26919 Comment 8 for tests
$ python3 /home/tester8/Documenten/thumbnail.py 
creates thumbnail for all jpeg files in the working directory: OK
$ python3
Python 3.8.11 (default, Jul 25 2021, 20:38:23) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>> im = Image.open( "0004.jpg")
>>> im.rotate( 45 ).show( )

shows rotated image 
>>> exit( )

All looks OK for me and Len seems haappy too.

Whiteboard: (none) => MGA8-64-OK
CC: (none) => herman.viaene

Comment 14 Len Lawrence 2021-08-03 18:30:40 CEST
Thanks Herman, but I had not started testing.  This is the afternoon's work.

mga8, x64

Tried out the scripts attached before updating - resulted in new images files which were displayed on the fly.

Updated the five packages.

The test scripts worked fine.
So did these:
$ python
Python 3.8.11 (default, Jul 25 2021, 20:38:23) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>> im = Image.open( "bookstudy.jpg" )
>>> im.rotate( 45 ).show( )
>>> exit()

$ python
>>> from PIL import Image
>>> import glob, os
>>> 
>>> size = 128, 128
>>> 
>>> for infile in glob.glob( "*.jpg" ):
...     file, ext = os.path.splitext( infile )
...     im = Image.open( infile )
...     im.thumbnail( size )
...     im.save( file + ".thumbnail", "JPEG" )
... 
>>> exit()
lcl@canopus:python-pillow $ ls *.thumbnail
bookstudy.thumbnail  ikapati.thumbnail      kappaCrucis.thumbnail
fox.thumbnail        JessicaAlba.thumbnail  kappaCru.thumbnail
hello2.thumbnail     jessica.thumbnail

The output thumbnails displayed fine with ImageMagick or eom and the 'next' function.

$ python
>>> from PIL import Image
>>> import numpy as np
>>> im = Image.open( "glenshiel.tiff" )
>>> a = np.asarray( im )
>>> im = Image.fromarray( a )
>>> im.show( )
>>> exit( )

That converted the input image to an array of data which was reassembled as a PNG image and displayed correctly.

From bug 25968
$ cat rgb.py
from PIL import Image

rgb2xyz = (
    0.412453, 0.357580, 0.180423, 0,
    0.212671, 0.715160, 0.072169, 0,
    0.019334, 0.119193, 0.950227, 0 )
im = Image.open( "glenshiel.tiff" )
out = im.convert( "RGB", rgb2xyz )    
out.show( )

$ python rgb.py
The displayed PNG image looked fine.

$ python
>>> from PIL import Image
>>> im = Image.open( "kappaCrucis.jpg" )
>>> im.show( )
>>> print( im.info )
{'jfif': 257, 'jfif_version': (1, 1), 'jfif_unit': 0, 'jfif_density': (1, 1)}
>>> print( im.palette )
None
>>> print( im.width, im.height )
2552 1702
>>> exit()

Philippe's test for j2k images:
$ wget https://github.com/python-pillow/Pillow/blob/master/Tests/images/rgb_trns_ycbc.j2k?raw=true
$ python
>>> import os, sys
>>> from PIL import Image
>>> infile = "rgb_trns_ycbc.j2k"
>>> outfile = "rgb_trns_ycbc.png"
>>> Image.open(infile).save(outfile)
>>> exit()

The output PNG image looks fine.

Good enough, although python3dist(pillow) is listed by urpmq --requires for calibre.  It might be difficult to trace that though so this gets the OK on the basis of the interactive tests.

$ urpmq --whatrequires python3-pillow | sort -u | wc -l
counts 48 applications, or 22 excluding python3.
Comment 15 Thomas Andrews 2021-08-06 02:55:39 CEST
Validating.

Keywords: (none) => validated_update
CC: (none) => andrewsfarm, sysadmin-bugs

Thomas Backlund 2021-08-06 10:37:50 CEST

Keywords: (none) => advisory

Comment 16 Mageia Robot 2021-08-06 11:35:07 CEST
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGASA-2021-0389.html

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.