Skip to content
Memory corruption Advisory Advanced CVE-2023-39316CVE-2023-39317

GTKWave LXT2 num_dict_entries integer overflow vulnerabilities

GTKWave 3.3.115 has integer overflow vulnerabilities in the LXT2 num_dict_entries handling when parsing .lxt2 files. A crafted file can cause heap out-of-bounds writes, potentially leading to arbitrary code execution when opened by a victim.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 7.8 View original

Multiple integer overflow vulnerabilities exist in the LXT2 numdictentries functionality of GTKWave 3.3.115. A specially crafted .lxt2 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 multiplication of num_dict_entries by the element size can overflow in 32-bit builds, causing malloc to allocate a smaller buffer than needed, leading to out-of-bounds writes in the subsequent loop.

Impact

A crafted .lxt2 file could cause heap out-of-bounds writes, potentially leading to arbitrary code execution, but only in 32-bit builds; 64-bit builds are not affected.

What the attacker needed

Victim opens a malicious .lxt2 file; 32-bit build of GTKWave

The fix

The vulnerabilities were fixed in version 3.3.118.

How it was found

  1. Open a malicious .lxt2 file with GTKWave or its command-line tools.
  2. The file is parsed by lxt2_rd_init, which reads block headers and stores them in a linked list.
  3. lxt2_rd_iter_blocks decompresses each block and calls lxt2_rd_process_block.
  4. In lxt2_rd_process_block, num_dict_entries is read from the block.
  5. Arrays string_pointers and string_lens are allocated with a size that may overflow.
  6. A loop writes to these arrays, causing out-of-bounds writes.

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. A trace file can contain a number that tells the program how many dictionary entries to expect. If that number is huge, a calculation to reserve memory can wrap around and reserve too little, so the program writes past the end of the reserved memory. This can crash the program or, with careful manipulation, 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.