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

Accusoft ImageGear XWD parser::xwdread_pixmapformat_0_or_1 heap-based buffer overflow vulnerability

A heap-based buffer overflow exists in the XWD parser of Accusoft ImageGear 19.10 because the allocated buffer size is based only on PixmapWidth and is not checked against BytesPerLine. An attacker can provide a malicious XWD 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 XWD parser 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

The destination buffer size is calculated solely from PixmapWidth without comparing it to BytesPerLine, so a larger BytesPerLine causes a heap overflow during memcpy.

Impact

An attacker could exploit this to execute arbitrary code, as indicated by the CVSS score of 9.8 and the report's statement that a crafted file can lead to code execution.

What the attacker needed

Malicious XWD file; victim opens file with vulnerable software

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 library opens a specially crafted image file, it copies more data into a memory buffer than the buffer can hold, 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.