VYPR
Unrated severityNVD Advisory· Published Apr 22, 2021· Updated Aug 3, 2024

CVE-2021-3496

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

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

News mentions

0

No linked articles in our index yet.