GTKWave EVCD var len parsing improper array index validation vulnerability
An improper array index validation in GTKWave's EVCD parser allows a crafted .evcd file to write a NULL byte to an arbitrary memory location, potentially leading to arbitrary code execution. The victim must open a malicious file.
Originally disclosed on Cisco Talos
An improper array index validation vulnerability exists in the EVCD var len parsing functionality of GTKWave 3.3.115. A specially crafted .evcd 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 length value parsed from the file is used directly as an index into a fixed-size stack buffer without bounds checking.
Impact
An attacker could write a NULL byte to an arbitrary memory location, potentially leading to arbitrary code execution.
What the attacker needed
Victim opens a malicious .evcd file
The fix
The vulnerability was fixed in version 3.3.118.
How it was found
- Create a .evcd file with a $var line that sets a large length value.
- Add a line starting with 'p' that references the same variable ID.
- Open the file with the evcd2vcd 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 electronic signal traces. A bug in how it reads a file format called EVCD lets an attacker write a zero byte to any place in the program's memory. This can crash the program or let the 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.