Skip to content
Memory corruption Advisory Advanced CVE-2023-38653CVE-2023-38652

GTKWave VZT vzt_rd_block_vch_decode dict parsing integer overflow vulnerabilities

Integer overflow in the calculation of buffer sizes for val_dict and change_dict in GTKWave's VZT file parsing leads to heap out-of-bounds writes. An attacker could cause memory corruption by crafting a malicious .vzt file that a victim opens.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 7.0 View original

Multiple integer overflow vulnerabilities exist in the VZT vztrdblockvchdecode dict parsing functionality of GTKWave 3.3.115. A specially crafted .vzt file can lead to memory corruption.

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 multiplication of num_sections and num_dict_entries can overflow a 32-bit integer, resulting in an undersized heap allocation that is then written past its bounds.

Impact

The out-of-bounds write could lead to memory corruption and possibly arbitrary code execution, depending on threading and heap implementation.

What the attacker needed

Victim opens a malicious .vzt file

The fix

The vendor fixed the issue in version 3.3.118.

How it was found

  1. Open a malicious .vzt file with GTKWave or its command-line tools.
  2. The file's block header sets start_time greater than end_time to enable RLE mode.
  3. The decompressed block data contains large num_sections and num_dict_entries values that cause an integer overflow in the size calculation.
  4. The program allocates a small buffer and then writes beyond it while decoding the dictionary.

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 electronic signal traces. When it opens a file, it calculates how much memory to reserve for some data. If the numbers in the file are huge, the calculation wraps around to a small number, so the program writes past the end of the reserved memory, corrupting other data. This 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 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.