Skip to content

fix(security): Bump Pillow#19662

Merged
untitaker merged 1 commit intomasterfrom
fix/bump-pillow
Jul 1, 2020
Merged

fix(security): Bump Pillow#19662
untitaker merged 1 commit intomasterfrom
fix/bump-pillow

Conversation

@untitaker
Copy link
Copy Markdown
Member

@untitaker untitaker requested review from joshuarli and mitsuhiko July 1, 2020 09:40
@untitaker
Copy link
Copy Markdown
Member Author

It seems that Pillow has released CVEs without actually releasing the versions that supposedly fix the security issues.

python-pillow/Pillow#4750

Copy link
Copy Markdown
Member

@billyvg billyvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock our CI, but we should follow up on this

@iProgramStuff iProgramStuff self-requested a review July 1, 2020 15:38
@untitaker untitaker merged commit f7dd579 into master Jul 1, 2020
@untitaker untitaker deleted the fix/bump-pillow branch July 1, 2020 16:06
@joshuarli
Copy link
Copy Markdown
Member

All these CVEs affect decoding of some less popular image formats (FLI, PCX, TIFF, JPEG 2000, SGI-RLE): python-pillow/Pillow#4538

So, sentry.models.avatar.get_cached_photo is unaffected (it only resizes and encodes into PNG).

I imagine not many people at all would care if we blocked everything but JPEG or PNG uploads. I know JPEG 2000 is slowly gaining in popularity, but hopefully we're on py3 by the time it's more universal?

The format can be identified by reading Image.format after an image open, or stdlib imghdr although if you search for "imghdr python bug" you get a lot of hits, haha. A few that look pretty good (but are py3-only): https://github.com/cdgriffith/puremagic, https://github.com/h2non/filetype.py. Calibre also maintains their own imghdr.py and I believe the creator/primary maintainer intends to support py2 for a long time.

@untitaker
Copy link
Copy Markdown
Member Author

untitaker commented Jul 1, 2020 via email

@joshuarli
Copy link
Copy Markdown
Member

Image types are generally(?) inferred from magic bytes, not during decoding. But I have not verified this.

@github-actions github-actions Bot locked and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants