Buffer overflow in LibRaw - CVE-2021-32142

 

Buffer overflow in LibRaw - CVE-2021-32142

Published: February 25, 2023


Vulnerability identifier: #VU72570
CSH Severity: High
CVSS v4: 8.6 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2021-32142
CWE-ID: CWE-119
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to execute arbitrary code on the target system.

The vulnerability exists due to a boundary error within the LibRaw_buffer_datastream::gets() function in /src/libraw/src/libraw_datastream.cpp. A remote attacker can create a specially crafted file, trick the victim into opening it, trigger memory corruption and execute arbitrary code on the target system.

Successful exploitation of this vulnerability may result in complete compromise of vulnerable system.


Affected software

LibRaw
Debian Linux
Oracle Linux
SUSE Linux Enterprise Desktop 15
SUSE Linux Enterprise High Performance Computing 15
SUSE Linux Enterprise Real Time 15
SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server for SAP Applications 15
SUSE Linux Enterprise Workstation Extension 15
SUSE Linux Enterprise High Performance Computing 12
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server for SAP Applications 12
SUSE Linux Enterprise Software Development Kit 12
SUSE Manager Server
SUSE Manager Retail Branch Server
SUSE Manager Proxy
CentOS
Red Hat Enterprise Linux for Power, little endian
Red Hat Enterprise Linux Server
Red Hat Enterprise Linux Workstation
Red Hat Enterprise Linux Desktop
Anolis OS
Red Hat CodeReady Linux Builder for x86_64
Red Hat Enterprise Linux for x86_64
Red Hat CodeReady Linux Builder for Power, little endian
Red Hat Enterprise Linux for IBM z Systems
Red Hat Enterprise Linux for ARM 64
SUSE Linux Enterprise Workstation Extension 12
Slackware Linux
Desktop Applications Module
openSUSE Leap
openEuler
Ubuntu
Fedora
libraw-devel-static
libraw9
libraw-devel
libraw-debugsource
libraw9-debuginfo
libraw16-debuginfo
libraw16
libraw-debuginfo
LibRaw-static
LibRaw
LibRaw-devel
LibRaw (Red Hat package)
libraw19 (Ubuntu package)
libraw (Debian package)
libraw20 (Ubuntu package)
LibRaw-debuginfo
LibRaw-debugsource
mingw-LibRaw
libraw20
libraw20-32bit-debuginfo
libraw20-32bit
libraw-tools-debuginfo
libraw20-debuginfo
libraw-tools

How to mitigate CVE-2021-32142

Install updates from vendor's website.

LibRaw - update to 0.20.1
libraw-devel-static - addressed in versions 0.15.4-36.1, 0.20.2-150400.3.3.1
libraw9 - update to 0.15.4-36.1
libraw-devel - addressed in versions 0.15.4-36.1, 0.20.2-150400.3.3.1
libraw-debugsource - addressed in versions 0.15.4-36.1, 0.18.9-150000.3.17.1, 0.20.2-150400.3.3.1
libraw9-debuginfo - update to 0.15.4-36.1
libraw16-debuginfo - update to 0.18.9-150000.3.17.1
libraw16 - update to 0.18.9-150000.3.17.1
libraw-debuginfo - update to 0.18.9-150000.3.17.1
LibRaw-static - update to 0.19.4-2
LibRaw - addressed in versions 0.19.4-2, 0.20.2-6
LibRaw-devel - addressed in versions 0.19.4-2, 0.20.2-6
LibRaw (Red Hat package) - addressed in versions 0.19.4-2.el7_9, 0.19.5-4.el8, 0.20.2-6.el9
libraw19 (Ubuntu package) - update to 0.19.5-1ubuntu1.2
LibRaw - update to 0.20.2
libraw (Debian package) - update to 0.20.2-1+deb11u1
libraw20 (Ubuntu package) - addressed in versions 0.20.2-2ubuntu2.22.04.1, 0.20.2-2ubuntu2.22.10.1, 0.20.2-2ubuntu2.23.04.1
LibRaw - addressed in versions 0.20.2-6, 0.20.2-7
LibRaw-devel - addressed in versions 0.20.2-6, 0.20.2-7
LibRaw-debuginfo - addressed in versions 0.20.2-6, 0.20.2-7
LibRaw-debugsource - addressed in versions 0.20.2-6, 0.20.2-7
mingw-LibRaw - addressed in versions 0.20.2-8.fc36, 0.20.2-8.fc37
libraw20 - update to 0.20.2-150400.3.3.1
libraw20-32bit-debuginfo - update to 0.20.2-150400.3.3.1
libraw20-32bit - update to 0.20.2-150400.3.3.1
libraw-tools-debuginfo - update to 0.20.2-150400.3.3.1
libraw20-debuginfo - update to 0.20.2-150400.3.3.1
libraw-tools - update to 0.20.2-150400.3.3.1

External References

Related Security Bulletins