Skip to content
Memory corruption Advisory Advanced CVE-2021-21914

Accusoft ImageGear DecoderStream::Append heap-based buffer overflow vulnerability

A heap-based buffer overflow exists in Accusoft ImageGear's DecoderStream::Append due to an integer overflow when calculating buffer size. An attacker can provide a malicious JPEG 2000 file to trigger the overflow, potentially leading to code execution.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

A heap-based buffer overflow vulnerability exists in the DecoderStream::Append functionality of Accusoft ImageGear 19.10. A specially-crafted file can lead to code execution.

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

Likely an integer overflow when adding a fixed size (0x1c) to a user-controlled size (bytes_size) during memory allocation, resulting in a too-small buffer that is later overflowed.

Impact

This could lead to a heap-based buffer overflow, which can result in remote code execution.

What the attacker needed

Victim opens a malicious JPEG 2000 file

How it was found

  1. Craft a malformed JPEG 2000 file with a size value that causes an integer overflow when 0x1c is added.
  2. Load the file using the ImageGear library, which calls DecoderStream::Append.
  3. The allocation function computes a small buffer size due to the overflow.
  4. Data from the file is copied into the undersized buffer, causing a heap overflow.
  5. The overflow corrupts heap memory, leading to a crash or potential code execution.

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.

This report describes a memory corruption bug in an image processing library. When the software tries to load a maliciously crafted image file, it miscalculates how much memory to reserve, then writes more data than fits, which can crash the program or let an attacker 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.