CVE-2022-0562
Description
Null source pointer passed as an argument to memcpy() function within TIFFReadDirectory() in tif_dirread.c in libtiff versions from 4.0 to 4.3.0 could lead to Denial of Service via crafted TIFF file. For users that compile libtiff from sources, a fix is available with commit 561599c.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
36- osv-coords34 versionspkg:rpm/almalinux/libtiffpkg:rpm/almalinux/libtiff-develpkg:rpm/almalinux/libtiff-toolspkg:rpm/opensuse/tiff&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/tiff&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/tiff&distro=openSUSE%20Tumbleweedpkg:rpm/suse/tiff&distro=SUSE%20Enterprise%20Storage%206pkg:rpm/suse/tiff&distro=SUSE%20Enterprise%20Storage%207pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-ESPOSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-ESPOSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-ESPOSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Micro%205.2pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-BCLpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-BCLpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP1pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Manager%20Proxy%204.1pkg:rpm/suse/tiff&distro=SUSE%20Manager%20Retail%20Branch%20Server%204.1pkg:rpm/suse/tiff&distro=SUSE%20Manager%20Server%204.1
< 4.0.9-23.el8+ 33 more
- (no CPE)range: < 4.0.9-23.el8
- (no CPE)range: < 4.0.9-23.el8
- (no CPE)range: < 4.0.9-23.el8
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.3.0-2.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-44.48.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-44.48.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-44.48.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
- (no CPE)range: < 4.0.9-150000.45.8.1
Patches
Vulnerability mechanics
Root cause
"Null pointer passed as the source argument to memcpy() in TIFFReadDirectory when td_sampleinfo is NULL but old_extrasamples is non-zero."
Attack vector
An attacker crafts a TIFF file with malformed directory entries that cause `tif->tif_dir.td_sampleinfo` to be NULL while `old_extrasamples` is non-zero. When `tiffinfo` (or any libtiff-based tool) parses this file, the `TIFFReadDirectory` function reaches the `memcpy(new_sampleinfo, tif->tif_dir.td_sampleinfo, ...)` call with a null source pointer, triggering undefined behavior and a crash [ref_id=1]. The attack requires no authentication and is delivered by convincing a user to process the crafted TIFF file.
Affected code
The vulnerability is in the `TIFFReadDirectory` function within `tif_dirread.c` at line 4176. The code passes a null pointer as the second argument to `memcpy()` when copying `tif->tif_dir.td_sampleinfo` into `new_sampleinfo` [ref_id=1].
What the fix does
The fix is available in commit 561599c. The patch adds a null-pointer check before the `memcpy()` call in `TIFFReadDirectory`, ensuring that when `tif->tif_dir.td_sampleinfo` is NULL, the copy is skipped or handled safely. This prevents the undefined behavior that leads to the denial of service [ref_id=1].
Preconditions
- inputThe victim must process a crafted TIFF file using a libtiff-based tool (e.g., tiffinfo).
- authNo authentication or special privileges required.
Reproduction
Compile libtiff 4.3.0 with AddressSanitizer and UndefinedBehaviorSanitizer enabled (e.g., `CFLAGS="-g -fsanitize=address,undefined"`). Run `./tiffinfo -f lsb2msb -Dcdjrsz crash.tif` against the crafted POC file from the crash.zip attachment [ref_id=1]. The tool will crash with a runtime error indicating a null pointer passed to `memcpy` at `tif_dirread.c:4176`.
Generated on May 24, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DZEHZ35XVO2VBZ4HHCMM6J6TQIDSBQOM/mitrevendor-advisory
- security.gentoo.org/glsa/202210-10mitrevendor-advisory
- www.debian.org/security/2022/dsa-5108mitrevendor-advisory
- lists.debian.org/debian-lts-announce/2022/03/msg00001.htmlmitremailing-list
- gitlab.com/gitlab-org/build/omnibus-mirror/libtiff/-/commit/561599c99f987dc32ae110370cfdd7df7975586bmitre
- gitlab.com/gitlab-org/cves/-/blob/master/2022/CVE-2022-0562.jsonmitre
- gitlab.com/libtiff/libtiff/-/issues/362mitre
- security.netapp.com/advisory/ntap-20220318-0001/mitre
News mentions
0No linked articles in our index yet.