Bug 2015231 - CVE-2021-28021 stb: buffer overflow in stbi__extend_receive() in stb_image.h via a crafted JPEG file [fedora-all]
Summary: CVE-2021-28021 stb: buffer overflow in stbi__extend_receive() in stb_image.h ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: stb
Version: 34
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Ben Beasley
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: CVE-2021-28021
TreeView+ depends on / blocked
 
Reported: 2021-10-18 17:15 UTC by Guilherme de Almeida Suckevicz
Modified: 2021-10-18 18:46 UTC (History)
2 users (show)

Fixed In Version: stb-0-0.4.20210908gitc0c9826.fc33, stb-0-0.4.20210908gitc0c9826.fc34, stb-0-0.4.20210908gitc0c9826.fc35, stb-0-0.4.20210908gitc0c9826.fc36
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 18:43:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Guilherme de Almeida Suckevicz 2021-10-18 17:15:41 UTC
This is an automatically created tracking bug!  It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of fedora-all.

For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.

For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs

When submitting as an update, use the fedpkg template provided in the next
comment(s).  This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.

Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.

NOTE: this issue affects multiple supported versions of Fedora. While only
one tracking bug has been filed, please correct all affected versions at
the same time.  If you need to fix the versions independent of each other,
you may clone this bug as appropriate.

Comment 1 Guilherme de Almeida Suckevicz 2021-10-18 17:15:43 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=2015229,2015231

# 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 Ben Beasley 2021-10-18 18:43:54 UTC
I am the maintainer of the “stb” package in Fedora and in EPEL.

The separate stb package in Fedora (and EPEL8 and EPEL7) is only a couple of months old, and the oldest packaged stb_image version was 2.27. Nevertheless, the initial packaged version was affected by this CVE, as explained in the following paragraph.

The CVE text claims the latest affected version is 2.26, but this is not quite right. The upstream fix in https://github.com/nothings/stb/commit/5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 came after the bump to stb_image 2.27 in https://github.com/nothings/stb/commit/3a7dcdd2696ed7b85f892f951b0801e382b81778—so even though the “stb” package has never contained stb_image 2.26 or earlier, the initial package *was* affected by the CVE, and the current version *is not* affected, even though both provide stb_image 2.27. Is that confusing enough?

The following are the Bodhi updates (each already in stable) in which the CVE was corrected.

F36: https://bodhi.fedoraproject.org/updates/FEDORA-2021-35ace22099
F35: https://bodhi.fedoraproject.org/updates/FEDORA-2021-f049bf1e9a
F34: https://bodhi.fedoraproject.org/updates/FEDORA-2021-91a1112a15
F33: https://bodhi.fedoraproject.org/updates/FEDORA-2021-7251e0ffa8
EPEL8: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-a3ef29c6c4
EPEL7: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-def1471d2b

Accordingly, there is no need for a further update to the stb package in response to this issue.

Since stb_image is a header-only library, fully eradicating vulnerable code associated with the “stb” package would require rebuilding any package that depends on “stb_image-devel” and/or “stb_image-static”.

Furthermore, since stb libraries are designed for bundling, it is likely that vulnerable versions do remain bundled with other packages in the distribution—either properly marked with “Provides: bundled(stb_image) = […]”, or, quite commonly, undetected. Wherever possible, I suggest migrating any such packages to use the unbundled stb_image-devel/stb_image-static provided here. I’m happy to assist with any such efforts upon request.

Please let me know if there is anything I can do.


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