GTKWave LXT2 facgeometry parsing integer overflow vulnerabilities
Multiple integer overflow vulnerabilities in GTKWave's LXT2 facgeometry parsing allow a crafted .lxt2 file to cause heap out-of-bounds writes, potentially leading to arbitrary code execution. A victim must open a malicious file to trigger the issue.
Originally disclosed on Cisco Talos
Multiple integer overflow vulnerabilities exist in the LXT2 facgeometry parsing functionality of GTKWave 3.3.115. A specially crafted .lxt2 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 (numfacs) by a constant without checking for integer overflow, so on 32-bit systems the result wraps to a small value, leading to undersized allocations and subsequent out-of-bounds writes.
Impact
A crafted file could cause heap out-of-bounds writes, potentially leading to arbitrary code execution, though the report notes the issue only affects 32-bit mode.
What the attacker needed
Victim opens a malicious .lxt2 file; 32-bit build of GTKWave
The fix
The vulnerabilities were fixed in version 3.3.118.
How it was found
- Craft a malicious .lxt2 file with a large numfacs value.
- Open the file with GTKWave or a related tool (e.g., lxt2vcd).
- The program allocates undersized buffers due to integer overflow.
- During parsing, it writes beyond the allocated buffers, causing heap corruption.
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 opens a file, it reads a number that tells it how many items to expect, then allocates memory based on that number. If the number is very large, a calculation can wrap around and allocate too little memory, so writing the items overflows the buffer and can corrupt memory, potentially letting an attacker run 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.