GTKWave LXT2 num_time_table_entries out-of-bounds write vulnerability
A crafted LXT2 file can cause an out-of-bounds write in GTKWave's time table array because the number of entries is read from the file without checking against the array size. An attacker could achieve arbitrary code execution by convincing a victim to open a malicious file.
Originally disclosed on Cisco Talos
An out-of-bounds write vulnerability exists in the LXT2 numtimetableentries 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 number of time table entries read from the file is not validated against the fixed size of the time_table array, leading to a heap buffer overflow.
Impact
An attacker could execute arbitrary code on the victim's machine by convincing them to open a malicious file.
What the attacker needed
Victim opens a malicious .lxt2 file
The fix
The vulnerability was fixed in version 3.3.118 by adding a check to ensure num_time_table_entries does not exceed the array size.
How it was found
- Create a malicious .lxt2 file with a block containing a time sector where num_time_table_entries exceeds 64.
- Open the file with GTKWave or a related tool (e.g., lxt2vcd).
- The program reads the oversized num_time_table_entries and writes past the time_table array.
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. When it opens a file, it reads a number that says how many time entries to store, but it doesn't check if that number is too big for the space reserved. This lets an attacker write past the end of an array, which can crash the program or run malicious 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.