Skip to content
Memory corruption Advisory Intermediate CVE-2023-36861

GTKWave VZT LZMA_read_varint out-of-bounds write vulnerability

A stack buffer overflow exists in GTKWave's LZMA_read_varint function when parsing VZT files, allowing an attacker to write beyond a 16-byte buffer by supplying a varint with no terminating byte. A victim opening a malicious .vzt file could trigger arbitrary code execution.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 7.8 View original

An out-of-bounds write vulnerability exists in the VZT LZMAreadvarint functionality of GTKWave 3.3.115. A specially crafted .vzt 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

The LZMA_read_varint function reads bytes into a fixed 16-byte stack buffer in a loop that only stops when a byte with the high bit set is read, without checking the buffer index against the buffer size.

Impact

A victim opening a malicious .vzt file could trigger a stack buffer overflow, potentially leading to arbitrary code execution.

What the attacker needed

Victim opens a malicious .vzt file

The fix

The vulnerability was fixed in version 3.3.118.

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 from electronic simulations. When it opens a compressed trace file, it reads numbers that tell it how big each block is. The code that reads these numbers uses a small fixed-size box on the stack (a temporary memory area) and keeps putting bytes into it without checking if the box is full. If a malicious file provides a number that never ends, the program writes past the box, corrupting memory and potentially letting an attacker 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.

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.