CVE-2021-3496
Description
A heap-based buffer overflow was found in jhead in version 3.06 in Get16u() in exif.c when processing a crafted file.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
4- jhead/jheaddescription
- osv-coords3 versionspkg:rpm/opensuse/jhead&distro=openSUSE%20Leap%2015.2pkg:rpm/opensuse/jhead&distro=openSUSE%20Tumbleweedpkg:rpm/suse/jhead&distro=SUSE%20Package%20Hub%2015%20SP2
< 3.00-lp152.7.3.1+ 2 more
- (no CPE)range: < 3.00-lp152.7.3.1
- (no CPE)range: < 3.06.0.1-1.3
- (no CPE)range: < 3.00-bp152.4.3.1
Patches
Vulnerability mechanics
Root cause
"Missing bounds check in Get16u() in exif.c allows reading beyond the allocated heap buffer when processing malformed EXIF metadata."
Attack vector
An attacker supplies a specially crafted JPEG file containing malformed EXIF metadata. When jhead (version 3.06) parses the file, the `ProcessCanonMakerNoteDir` function calls `Get16u()` with an offset that reads beyond the allocated heap buffer [ref_id=1]. The ASan report shows the read occurs 9 bytes to the right of a 1164-byte region allocated in `ReadJpegSections` at `jpgfile.c:175` [ref_id=1]. No authentication or special network access is required — the attacker only needs to deliver the crafted file to a victim who processes it with jhead.
Affected code
The vulnerability resides in `Get16u()` in `exif.c` and is triggered through the call chain `ProcessCanonMakerNoteDir` in `makernote.c:128:27` → `ProcessMakerNote` → `ProcessExifDir` → `process_EXIF` → `ReadJpegSections` [ref_id=1]. The ASan trace shows a heap-buffer-overflow READ of size 1 at `Get16u` when processing a crafted JPEG file [ref_id=1].
What the fix does
The bundle does not contain a patch. The advisory [ref_id=1] reports the heap-buffer-overflow in jhead 3.06 (commit 871e319) but provides no fix or remediation guidance. Based on the nature of the bug, a proper fix would require adding bounds checking in `Get16u()` (or its callers) to verify that the read offset does not exceed the allocated buffer size before dereferencing the pointer.
Preconditions
- inputVictim must process a crafted JPEG file with jhead 3.06
- authNo authentication required
- networkFile can be delivered locally or via any file-transfer mechanism
Generated on May 29, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
3- security.gentoo.org/glsa/202210-17mitrevendor-advisory
- bugzilla.redhat.com/show_bug.cgimitre
- github.com/Matthias-Wandel/jhead/issues/33mitre
News mentions
0No linked articles in our index yet.