Impact
The vulnerability lies in kitty’s drag source staging path for the drag and drop protocol. The implementation builds a path string and opens it with safe_open(…, O_DIRECTORY | O_RDONLY, 0) instead of validating each path component, allowing an attacker to craft a symlink whose target points to an arbitrary absolute directory and follow that link during file creation. When a client creates two entries with the same name—a symlink and then a directory—the code ignores a failed mkdirat, follows the symlink, and passes the resulting directory descriptor to add_payload, which is then used for every following create operation. This lets an attacker create files with O_CREAT | O_WRONLY | O_EXCL, mode 0644, and directories with mkdirat, mode 0755, anywhere that the kitty process user can write. Existing files cannot be overwritten, but new files and intermediate directories can be introduced outside the intended staging directory.
Affected Systems
Affected product is kitty, the terminal emulator from Kovid Goyal. All releases from 0.47.0 up to, but excluding, 0.49.0 are vulnerable. The issue appears when the drag and drop protocol is enabled, so any installation of those versions that allows dragging into other programs is at risk.
Risk and Exploitability
The CVSS score of 4.6 reflects moderate severity. EPSS data is not available, making the exploit probability unknown. The vulnerability is not in the CISA KEV catalog. Because the attack requires a program that can write to the terminal, it represents a local threat; it does not provide remote network access. An attacker with access to a process that writes to kitty’s terminal can place arbitrary files or directories at any location writable by that user, potentially compromising configuration files or launching subsequent attacks. Prompt mitigation is required to prevent exploitation.
OpenCVE Enrichment