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

Accusoft ImageGear XWD parser heap-based buffer overflow vulnerability

A heap-based buffer overflow exists in the XWD parser of Accusoft ImageGear 19.10 because the destination buffer size is calculated from the image width and depth without checking it against the BytesPerLine value from the file. 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

Likely, the destination buffer size is computed from the image width and depth without comparing it to the BytesPerLine value from the file, leading to a heap buffer overflow when copying BytesPerLine bytes.

Impact

An attacker could potentially execute arbitrary code by providing a malicious XWD file, as indicated by the CVSS score of 9.8 and the crash showing a write access violation.

What the attacker needed

Victim opens a malicious XWD 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.

This report describes a memory corruption bug in a library that reads image files. When the library processes a specially crafted XWD image, it copies more data into a buffer than the buffer can hold, which can crash the program or allow an attacker to run their own code. The root cause is that the program trusts a size value from the file without verifying it against the actual buffer size.

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.