Skip to content
Memory corruption Advisory Advanced CVE-2023-37416CVE-2023-37419CVE-2023-37420CVE-2023-37418CVE-2023-37417

GTKWave VCD parse_valuechange portdump out-of-bounds write vulnerabilities

GTKWave's VCD parser has an off-by-one heap buffer overflow when handling port dump values, allowing a crafted .vcd file to write a null byte out of bounds. An attacker could exploit this to execute arbitrary code when a victim opens the malicious file.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 7.8 View original

Multiple out-of-bounds write vulnerabilities exist in the VCD parsevaluechange portdump functionality of GTKWave 3.3.115. A specially crafted .vcd 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 code checks if the buffer size is less than the required size, but it should check if it is less than or equal to, because the string copy also writes a null terminator.

Impact

A crafted .vcd file could lead to arbitrary code execution, though the report notes that heap massaging is required and the write is only a single null byte.

What the attacker needed

Victim opens a malicious .vcd file; GTKWave version 3.3.115 or similar

The fix

The buffer size check should be changed to use less-than-or-equal, and the vendor fixed the issue in version 3.3.118.

How it was found

  1. Create a VCD file with a $var declaration for a port with a specific size.
  2. Include a $enddefinitions token to mark the end of the header.
  3. Add a value change line starting with 'p' followed by a port value and an identifier that matches the declared port.
  4. Open the file with GTKWave or a conversion utility to trigger the out-of-bounds write.

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. A specially crafted trace file can cause the program to write one byte past the end of a memory buffer, which can crash it or, with extra work, let an attacker run their own code. The victim just needs to open the malicious 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.

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.