Skip to content
Memory corruption Advisory Advanced CVE-2021-21947CVE-2021-21946

Accusoft ImageGear JPEG-JFIF lossless Huffman parser heap-based buffer overflow vulnerabilities

Two heap-based buffer overflow vulnerabilities exist in the JPEG-JFIF lossless Huffman parser of Accusoft ImageGear 19.10. A specially crafted JPEG file can trigger a heap buffer overflow, potentially leading to code execution.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

Two heap-based buffer overflow vulnerabilities exists in the JPEG-JFIF lossless Huffman image parser functionality of Accusoft ImageGear 19.10. A specially-crafted file can lead to a heap buffer overflow.

Francesco Benvenuto, on Cisco Talos

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The buffer size calculation for each component does not account for the maximum possible offset used when writing pixel data, and there is no boundary check before writing.

Impact

An attacker could exploit this to cause a heap buffer overflow, potentially leading to code execution with the privileges of the application.

What the attacker needed

Victim opens a malicious JPEG file; application uses ImageGear 19.10

How it was found

  1. Craft a JPEG-JFIF file with a SOF3 segment and specific component subsampling values.
  2. Set the image dimensions and precision to trigger the overflow condition.
  3. Load the malicious file in an application using Accusoft ImageGear 19.10.
  4. The parser writes past the allocated buffer, causing an access violation.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A heap buffer overflow happens when a program writes more data into a memory area than it was allocated for. Here, a malformed JPEG image causes the image parser to write past the end of a buffer, which can crash the program or allow an attacker to run their own code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Francesco Benvenuto

View all

152 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.