Bug 2247821

Summary: CVE-2023-44271 python-pillow: uncontrolled resource consumption when textlength in an ImageDraw instance operates on a long text argument [fedora-all]
Product: [Fedora] Fedora Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: python-pillowAssignee: Sandro Mani <manisandro>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 38CC: epel-packagers-sig, infra-sig, lbalhar, manisandro, python-packagers-sig
Target Milestone: ---Keywords: Reopened, Security, SecurityTracking
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-pillow-9.5.0-1.fc38 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-05-31 08:52:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2247820    

Description Guilherme de Almeida Suckevicz 2023-11-03 16:43:49 UTC
More information about this security flaw is available in the following bug:

http://bugzilla.redhat.com/show_bug.cgi?id=2247820

Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

Comment 1 Guilherme de Almeida Suckevicz 2023-11-03 16:43:52 UTC
Use the following template to for the 'fedpkg update' request to submit an
update for this issue as it contains the top-level parent bug(s) as well as
this tracking bug.  This will ensure that all associated bugs get updated
when new packages are pushed to stable.

=====

# bugfix, security, enhancement, newpackage (required)
type=security

# low, medium, high, urgent (required)
severity=medium

# testing, stable
request=testing

# Bug numbers: 1234,9876
bugs=2247820,2247821

# Description of your update
notes=Security fix for [PUT CVEs HERE]

# Enable request automation based on the stable/unstable karma thresholds
autokarma=True
stable_karma=3
unstable_karma=-3

# Automatically close bugs when this marked as stable
close_bugs=True

# Suggest that users restart after update
suggest_reboot=False

======

Additionally, you may opt to use the bodhi web interface to submit updates:

https://bodhi.fedoraproject.org/updates/new

Comment 2 Fedora Update System 2023-11-03 17:32:21 UTC
FEDORA-2023-1a120657f9 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-1a120657f9

Comment 3 Fedora Update System 2023-11-04 03:45:36 UTC
FEDORA-2023-1a120657f9 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-1a120657f9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-1a120657f9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2023-11-12 01:42:51 UTC
FEDORA-2023-1a120657f9 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 5 Lumír Balhar 2023-11-12 11:03:58 UTC
I'm reopening this bug for the reason provided in the Bodhi update:

Unfortunately, the patch backported from upstream from version 10 to fix the CVE-2023-44271 is not enough for version 9.5 we have in Fedora 38. The problem is that classes in ImageFont module have also `getsize` method which is deprecated in version 9 and removed in version 10 which means that the fix in version 10 is not applied to these methods and they stay vulnerable in this update.

Comment 6 Fedora Update System 2023-11-21 18:18:50 UTC
FEDORA-2023-13b03a90f9 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-13b03a90f9

Comment 7 Fedora Update System 2023-11-22 03:04:29 UTC
FEDORA-2023-13b03a90f9 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-13b03a90f9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-13b03a90f9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2024-01-28 02:53:50 UTC
FEDORA-2024-4ef97ebbfc has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-4ef97ebbfc`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-4ef97ebbfc

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Lumír Balhar 2024-01-29 08:20:59 UTC
As I mentioned earlier, the patch in version 9 is not enough to fix the vulnerability. I'm willing to help fix it.

The patch uses a function which is not backported as a part of the patch:

File "/usr/lib64/python3.11/site-packages/PIL/ImageFont.py", line 483, in getsize
    _string_length_check(text)
    ^^^^^^^^^^^^^^^^^^^^
NameError: name '_string_length_check' is not defined

Comment 10 Aoife Moloney 2024-05-31 08:52:59 UTC
Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21.

Fedora Linux 38 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.