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.
Originally disclosed on Cisco Talos
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.
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
- Craft an .fst file that starts with a valid header block so parsing continues.
- Include a geometry block or hierarchy block to set up signal lengths.
- Include a VCDATA block with a chain table and a time section whose tsec_nitems controls the tc_head array size.
- Set the tdelta value in the VCDATA element to an out-of-bounds index.
- 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.