Skip to content
Memory corruption Advisory Advanced CVE-2023-23567

Accusoft ImageGear CreateDIBfromPict out-of-bounds write vulnerability

A heap-based buffer overflow in Accusoft ImageGear's CreateDIBfromPict function occurs when a malformed PICT file causes a buffer to be undersized, leading to an out-of-bounds write. An attacker could exploit this to execute arbitrary code.

Emmanuel Tacheau Follow

Originally disclosed on Cisco Talos

High 8.1 View original

A heap-based buffer overflow vulnerability exists in the CreateDIBfromPict functionality of Accusoft ImageGear 20.1. A specially crafted file can lead to arbitrary code execution.

Emmanuel Tacheau, 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 destination buffer size is calculated using the image height from the header, but the loop that copies data uses a height from the opcode data, which can be larger, causing an out-of-bounds write.

Impact

This issue allows for an out-of-bounds write in heap, which could in turn allow an attacker to execute arbitrary code.

What the attacker needed

Victim opens a malicious PICT file

The fix

The vendor released a patch on 2023-09-20.

How it was found

  1. Craft a malformed PICT file with a DirectBitsRect opcode where the dstRect height exceeds the image height.
  2. Load the file using ImageGear's IG_load_file function.
  3. The CreateDIBfromPict function processes the opcode and performs a memcpy that writes beyond the allocated buffer.

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 buffer than it can hold, potentially overwriting other data. Here, a malformed image file tricks the software into copying too much data, which could 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 Emmanuel Tacheau

View all

58 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.