GTKWave FST FST_BL_GEOM parsing maxhandle integer overflow vulnerability
An integer overflow in GTKWave's FST file parsing, when compiled as a 32-bit binary, allows a crafted .fst file to cause a heap buffer overflow. An attacker could achieve memory corruption and potentially execute arbitrary code if the victim opens the malicious file.
Originally disclosed on Cisco Talos
An integer overflow vulnerability exists in the FSTBLGEOM parsing maxhandle functionality of GTKWave 3.3.115, when compiled as a 32-bit binary. A specially crafted .fst file can lead to memory corruption.
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 maxhandle value read from the file is a 64-bit number stored in a 32-bit variable, and multiplying it by 4 for a buffer allocation overflows on 32-bit builds, leading to an undersized buffer and out-of-bounds writes.
Impact
An attacker could cause memory corruption and potentially execute arbitrary code, though the CVSS score indicates high attack complexity and requires user interaction.
What the attacker needed
Victim opens a malicious .fst file; GTKWave compiled as 32-bit
The fix
The vulnerability was fixed in version 3.3.118.
How it was found
- Craft an .fst file that starts with a header section (FST_BL_HDR) with non-zero start or end time.
- Include a geometry section (FST_BL_GEOM) with a large maxhandle value that causes the allocation size to wrap.
- Open the file with GTKWave or its command-line tools, triggering 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 waveforms. A specially made waveform file can trick the program into writing data past the end of a memory buffer, which can crash it or let an attacker run their own code. The victim just needs to open the 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.