GTKWave decompression OS command injection vulnerabilities
GTKWave passes unsanitised input file names to shell commands when decompressing gzip or bzip2 files, allowing command injection. An attacker could execute arbitrary commands if a victim opens a maliciously named wave file.
Originally disclosed on Cisco Talos
Multiple OS command injection vulnerabilities exist in the decompression functionality of GTKWave 3.3.115. A specially crafted wave file can lead to arbitrary command 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 application concatenates an unsanitised file name into a shell command string and executes it with popen, without escaping shell metacharacters.
Impact
An attacker could execute arbitrary commands on the victim's machine with the privileges of the GTKWave process, but the victim must open a malicious file.
What the attacker needed
Victim opens a malicious file; file name contains shell metacharacters; GTKWave version 3.3.115 or earlier
The fix
The vulnerabilities were fixed in version 3.3.118.
How it was found
- Create a wave file with a name containing shell metacharacters and a compressed extension such as .ghw.gz or .gz.
- Deliver the file to the victim, for example by email, so that opening it triggers GTKWave.
- When the victim opens the file, GTKWave detects the compression magic or extension and builds a decompression command.
- The command string includes the malicious file name and is passed to popen, executing the injected commands.
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 waveforms. When it opens a compressed file, it builds a shell command by pasting the file name into a decompression command. If the file name contains special shell characters, those characters are interpreted by the shell, so an attacker can make the program run their own commands.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.