Skip to content
Memory corruption Advisory Advanced CVE-2023-35994CVE-2023-35996CVE-2023-35997CVE-2023-35995

GTKWave FST fstReaderIterBlocks2 tdelta improper array index validation vulnerabilities

GTKWave's FST file parser fails to validate the tdelta index used to access the tc_head array, allowing a crafted .fst file to cause out-of-bounds heap writes. An attacker could achieve arbitrary code execution by convincing a victim to open a malicious file.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 7.8 View original

Multiple improper array index validation vulnerabilities exist in the fstReaderIterBlocks2 tdelta functionality of GTKWave 3.3.115. A specially crafted .fst 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 uses a value read from the file (tdelta) as an array index without checking that it is smaller than the array's size.

Impact

A crafted .fst file could lead to arbitrary code execution when opened by the victim.

What the attacker needed

Victim opens a malicious .fst file

How it was found

  1. Craft an .fst file that starts with a valid header block so parsing continues.
  2. Include a geometry block or hierarchy block to set up signal lengths.
  3. Include a VCDATA block with a chain table and a time section whose tsec_nitems controls the tc_head array size.
  4. Set the tdelta value in the VCDATA element to an out-of-bounds index.
  5. Open the crafted file in GTKWave or with fst2vcd to trigger the out-of-bounds write.

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 specially crafted trace file can trick the program into writing data outside the memory it reserved, which can let an attacker run their own code on the victim's computer. The victim only needs to open the malicious 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.