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

GTKWave VZT LZMA_Read dmem extraction out-of-bounds write vulnerability

A heap buffer overflow exists in GTKWave's LZMA decompression when parsing VZT files, because the destination buffer is allocated using one length but filled using a different, attacker-controlled length. An attacker could exploit this to execute arbitrary code when a victim opens a malicious file.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 7.8 View original

An out-of-bounds write vulnerability exists in the VZT LZMARead dmem extraction functionality of GTKWave 3.3.115. A specially crafted .vzt file can lead to arbitrary code execution.

Claudio Bozzato, 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 code allocates a heap buffer using a length read from the file (dstlen) but then reads data into it using a separate, unchecked length (srclen), allowing srclen to exceed the buffer size.

Impact

A victim opening a malicious file could trigger a heap buffer overflow, potentially leading to arbitrary code execution.

What the attacker needed

Victim opens a malicious .vzt file

The fix

The vulnerability was fixed in version 3.3.118.

How it was found

  1. Craft a VZT file with a compressed block where the source length (srclen) is larger than the destination length (dstlen).
  2. Open the crafted file with GTKWave or its command-line tools (e.g., vzt2vcd).
  3. The LZMA_read function allocates dmem based on dstlen and then reads srclen bytes into it, causing a heap overflow.

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.

GTKWave is a program for viewing signal traces from electronic simulations. It reads compressed files, and when decompressing one part, it reserves a small space in memory but then writes more data than fits, which can corrupt memory and let an attacker run their own code. The victim just needs to open a malicious trace file.

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 Claudio Bozzato

View all

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