GTKWave LXT2 lxt2_rd_iter_radix shift operation integer underflow vulnerabilities
GTKWave's LXT2 file parser has an integer underflow in the lxt2_rd_iter_radix shift operation, where a crafted .lxt2 file can cause a memmove with a negative size, leading to memory corruption. An attacker could exploit this to execute arbitrary code if a victim opens a malicious file.
Originally disclosed on Cisco Talos
Multiple integer underflow vulnerabilities exist in the LXT2 lxt2rditerradix shift operation functionality of GTKWave 3.3.115. A specially crafted .lxt2 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 length of a value buffer can be set to zero, and when a shift operation subtracts one from this length, it underflows to a huge number, causing memmove to copy an excessive amount of data.
Impact
An attacker could exploit this memory corruption to execute arbitrary code, though the CVSS score indicates high attack complexity and user interaction is required.
What the attacker needed
Victim opens a malicious .lxt2 file
The fix
The vulnerability was fixed in version 3.3.118.
How it was found
- Craft an LXT2 file with msb and lsb values that make len zero.
- Open the file in GTKWave or a tool using lxt2_read.c.
- The parser processes the block and reaches lxt2_rd_iter_radix.
- A shift operation triggers memmove with a negative size, causing memory 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. A specially made trace file can trick the program into copying too much data in memory, 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.