Skip to content
Memory corruption Advisory Advanced CVE-2023-35989

GTKWave LXT2 zlib block allocation integer overflow vulnerability

An integer overflow in GTKWave's LXT2 file parsing allows a crafted file to cause a heap buffer overflow, potentially leading to arbitrary code execution. A victim must open a malicious .lxt2 file to trigger the vulnerability.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 7.8 View original

An integer overflow vulnerability exists in the LXT2 zlib block allocation functionality of GTKWave 3.3.115. A specially crafted .lxt2 file can lead to arbitrary code execution.

Claudio Bozzato, on Cisco Talos

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

Likely an integer overflow when calculating the buffer size (clen * 2) for decompression, leading to a too-small allocation and subsequent out-of-bounds write.

Impact

A crafted file could lead to arbitrary code execution, though the attacker must convince the victim to open the file.

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

  1. Craft an LXT2 file with a block that does not start with gzip magic and has a large compressed size value.
  2. Open the file in GTKWave or a related tool.
  3. The parser reads the compressed size, overflows the buffer size calculation, allocates a tiny buffer, and then reads the large compressed data into it, causing a heap overflow.

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 bug in how it reads a certain file format lets an attacker craft a file that, when opened, can crash the program or run malicious code. The attacker needs the victim to open the file, for example by double-clicking an email attachment.

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.

More by Claudio Bozzato

View all

185 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.