KiCad Plugin Directory Traversal Remote Code Execution Vulnerability
KiCad fails to properly validate a user-supplied path when handling plugin packages, allowing a crafted package to write files outside the intended directory. An attacker can exploit this to execute arbitrary code as the current user if the victim opens a malicious file or visits a malicious page.
Originally disclosed on Zero Day Initiative
This vulnerability allows remote attackers to execute arbitrary code on affected installations of KiCad. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.
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 the plugin package extraction routine joins archive entry names to a destination path without checking for '..' sequences or absolute paths, so entries can escape the intended directory.
Impact
An attacker could execute arbitrary code in the context of the current user, but the victim must first open a malicious file or visit a malicious page.
What the attacker needed
Victim opens a malicious file; or victim visits a malicious page
The fix
KiCad was fixed by an update that adds proper validation of paths in plugin packages.
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.
KiCad is a program for designing circuit boards, and it can load add-on 'plugin' packages. This report says that when KiCad unpacks a plugin, it does not check where the files inside are allowed to go, so a malicious plugin can place files in other folders on your computer. Because those files can be run automatically, an attacker could run their own code on your machine.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.