GTKWave VZT facgeometry parsing integer overflow vulnerabilities
GTKWave 3.3.115 has integer overflow vulnerabilities in the VZT facgeometry parsing code. A specially crafted .vzt file can cause heap out-of-bounds writes, potentially leading to arbitrary code execution when opened by a victim.
Originally disclosed on Cisco Talos
Multiple integer overflow vulnerabilities exist in the VZT facgeometry parsing functionality of GTKWave 3.3.115. A specially crafted .vzt 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 size calculation for several heap buffers multiplies a user-controlled count by 4 without checking for overflow, so in 32-bit mode the result wraps to a small value and subsequent writes go out of bounds.
Impact
A victim opening a malicious file could allow an attacker to execute arbitrary code, though the issue only affects 32-bit builds.
What the attacker needed
Victim opens a malicious .vzt file; 32-bit build of GTKWave
The fix
The vendor fixed the issue in version 3.3.118.
How it was found
- Craft a .vzt file with a large numfacs value.
- Open the file with GTKWave or a command-line tool.
- The program allocates undersized buffers and writes past them.
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. When it reads a file, it calculates how much memory to reserve based on a number from the file. If that number is very large, the calculation can wrap around and reserve too little memory, so writing data later spills over into other memory. An attacker can craft a file that exploits this to 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.