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

GTKWave FST fstReaderIterBlocks2 time_table tsec_nitems integer overflow vulnerability

An integer overflow in GTKWave's fstReaderIterBlocks2 function when parsing a crafted .fst file can cause a heap buffer overflow, allowing an attacker to corrupt memory and potentially execute arbitrary code. The victim must open a malicious file to trigger the vulnerability.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 7.0 View original

An integer overflow vulnerability exists in the fstReaderIterBlocks2 timetable tsecnitems 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 integer overflow occurs because the number of time table items (tsec_nitems) is multiplied by the size of each item without checking for overflow, leading to an undersized allocation.

Impact

An attacker could exploit this to execute arbitrary code, though on some systems the overflow is detected and only causes a crash.

What the attacker needed

Victim opens a malicious .fst file

The fix

It was fixed in version 3.3.118.

How it was found

  1. Craft a .fst file starting with a header sector (0x00) to set hdr_seen.
  2. Include a VCDATA block with a time section where tsec_nitems is set to a large value that overflows when multiplied by 8.
  3. Open the crafted file in GTKWave or use the fst2vcd command-line tool.
  4. The program allocates a small buffer due to overflow and then writes out-of-bounds while parsing the time table.

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. A bug in how it reads a file's time table can make it allocate a tiny memory buffer but then write many values into it, overflowing the buffer. This can crash the program 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.