Skip to content
Memory corruption Advisory Advanced CVE-2023-36747CVE-2023-36746

GTKWave FST fstReaderIterBlocks2 fstWritex len heap-based buffer overflow vulnerabilities

GTKWave 3.3.115 has heap-based buffer overflows in fstReaderIterBlocks2 when parsing a crafted .fst file, because signal_lens values are not checked against the actual data buffer. An attacker could cause memory corruption, potentially leading to code execution, if a victim opens a malicious file.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 7.0 View original

Multiple heap-based buffer overflow vulnerabilities exist in the fstReaderIterBlocks2 fstWritex len functionality of GTKWave 3.3.115. A specially crafted .fst 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

Likely the code does not validate that the length value taken from the file (signal_lens) fits within the actual data buffer before passing it to a memory copy function, and a signed/unsigned mismatch allows a negative length.

Impact

An attacker could cause memory corruption, potentially leading to arbitrary code execution, though the CVSS vector indicates local access and user interaction are required.

What the attacker needed

Victim opens a malicious .fst file

The fix

The vulnerability was fixed in version 3.3.118.

How it was found

  1. Create a .fst file that starts with a valid header section (FST_BL_HDR) with non-zero start or end time.
  2. Include a geometry section (FST_BL_GEOM) that sets a signal_lens value larger than 0x7fffffff.
  3. Include a VCDATA block with a time table and a value change entry whose least significant bit is 1.
  4. Open the crafted file with GTKWave or fst2vcd, causing fstReaderIterBlocks2 to call fstWritex with the oversized length.

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 waveforms from electronic simulations. It reads files that describe these waveforms. A bug in how it reads a particular file format (.fst) means that a malicious file can make the program write data past the end of a memory buffer, which can crash it or 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.