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

Accusoft ImageGear PNG png_palette_process memory corruption vulnerability

A malformed PNG file with a width of 1 and a bit depth of 2 causes a heap buffer overflow in the png_palette_process function of Accusoft ImageGear 19.9. An attacker could exploit this out-of-bounds write to corrupt heap memory and potentially achieve code execution.

Emmanuel Tacheau Follow

Originally disclosed on Cisco Talos

High 8.1 View original

A memory corruption vulnerability exists in the PNG pngpaletteprocess functionality of Accusoft ImageGear 19.9. A specially crafted malformed file can lead to a heap buffer overflow.

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 png_palette_process function writes two bytes per iteration into a buffer whose size is derived from the image width, without checking that the buffer is large enough for the number of iterations determined by the colour type and bit depth.

Impact

A one-byte out-of-bounds write causes heap corruption, which could lead to code execution with careful heap manipulation.

What the attacker needed

Malformed PNG file; victim opens the file

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.

When a program reads an image file, it often copies data into a memory buffer sized based on values in the file. If the program does not check that the data fits, it can write past the end of the buffer, corrupting nearby memory. Here, a PNG file with a tiny width and a specific bit depth makes the program write one byte too many, which can crash the program or, with careful setup, 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.