CVE-2022-1622
Description
LibTIFF master branch has an out-of-bounds read in LZWDecode in libtiff/tif_lzw.c:619, allowing attackers to cause a denial-of-service via a crafted tiff file. For users that compile libtiff from sources, the fix is available with commit b4e79bfa.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
28- osv-coords26 versionspkg:rpm/opensuse/tiff&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/tiff&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/tiff&distro=openSUSE%20Leap%20Micro%205.3pkg:rpm/opensuse/tiff&distro=openSUSE%20Leap%20Micro%205.4pkg:rpm/suse/tiff&distro=SUSE%20Enterprise%20Storage%207.1pkg: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-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-ESPOSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Micro%205.2pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Micro%205.3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Micro%205.4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Micro%205.5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-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%2015%20SP1pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5
< 4.0.9-150000.45.35.1+ 25 more
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-44.74.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-44.74.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-150000.45.35.1
- (no CPE)range: < 4.0.9-44.74.1
Patches
Vulnerability mechanics
Root cause
"Missing error-state tracking in LZWDecode allows out-of-bounds reads from the code table after a prior decoding error."
Attack vector
An attacker supplies a crafted TIFF file that, when processed by `tiffcp` (or any tool using `LZWDecode`), causes the LZW decoder to attempt reading from a code not yet in the table [ref_id=1]. This results in a read from a NULL or near-NULL pointer (address 0x00000000000b), leading to a segmentation fault [ref_id=1]. The attack requires no authentication; the victim only needs to open the malicious file with a libtiff-based utility [ref_id=1].
Affected code
The out-of-bounds read occurs in the `LZWDecode` function in `libtiff/tif_lzw.c` at lines 619 and 624 [ref_id=1]. The crash is triggered when `tiffcp` calls `TIFFReadScanline`, which invokes `LZWDecode` on a crafted TIFF file [ref_id=1].
What the fix does
The fix [patch_id=b4e79bfa] adds a `read_error` flag to the LZW decoder state structure, initializes it to zero in `LZWPreDecode`, and checks it at the start of `LZWDecode` — if a prior read error occurred, the function immediately returns 0 [ref_id=2]. The flag is set to 1 in the `error_code` path (where "Using code not yet in table" is reported) [ref_id=2]. This prevents any subsequent attempt to read from the same strip or tile after an error, avoiding the out-of-bounds access that caused the SEGV [ref_id=2].
Preconditions
- inputVictim must open a crafted TIFF file using a libtiff-based tool (e.g., tiffcp)
- authNo authentication or special privileges required
Reproduction
Use the provided PoC files (poc1, poc2) from the issue tracker [ref_id=1]. Build libtiff with AddressSanitizer enabled (`CFLAGS="-g -fsanitize=address -fno-omit-frame-pointer" ./configure --disable-shared; make; make install`). Run `./build_asan/bin/tiffcp -i poc1 /tmp/foo` or `./build_asan/bin/tiffcp -i poc2 /tmp/foo` to reproduce the SEGV in `LZWDecode` at lines 619 or 624 [ref_id=1].
Generated on May 24, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
15- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/C7IWZTB4J2N4F5OR5QY4VHDSKWKZSWN3/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UXAFOP6QQRNZD3HPZ6BMCEZZOM4YIZMK/mitrevendor-advisory
- seclists.org/fulldisclosure/2022/Oct/28mitremailing-list
- seclists.org/fulldisclosure/2022/Oct/39mitremailing-list
- seclists.org/fulldisclosure/2022/Oct/41mitremailing-list
- gitlab.com/gitlab-org/cves/-/blob/master/2022/CVE-2022-1622.jsonmitre
- gitlab.com/libtiff/libtiff/-/commit/b4e79bfa0c7d2d08f6f1e7ec38143fc8cb11394amitre
- gitlab.com/libtiff/libtiff/-/issues/410mitre
- security.netapp.com/advisory/ntap-20220616-0005/mitre
- support.apple.com/kb/HT213443mitre
- support.apple.com/kb/HT213444mitre
- support.apple.com/kb/HT213446mitre
- support.apple.com/kb/HT213486mitre
- support.apple.com/kb/HT213487mitre
- support.apple.com/kb/HT213488mitre
News mentions
0No linked articles in our index yet.