MEDIUM · CVSS 3.1 4.7

RUSTSEC-2026-0430: Path traversal in `rio-vt` Kitty graphics protocol handler allows out-of-bounds file delete (and read)

Published 2026-11-01 · Updated 2026-11-02

Summary

A path traversal vulnerability in the Kitty graphics protocol handler of `rio-vt` allows attackers to delete and read arbitrary files via crafted escape sequences. Terminal emulators and applications built on `rio-vt` versions prior to 0.5.29 should upgrade immediately.

Who is affected

Any terminal emulator or application using `rio-vt` versions before 0.5.29 that processes untrusted output (such as SSH sessions, cat'd files, or CI logs) is affected. The vulnerability requires the attacker to control terminal output that includes a malicious Kitty graphics protocol escape sequence with a crafted file path containing the substring 'tty-graphics-protocol' and directory traversal sequences. When the temp-file transmission medium is used, the application will read and delete the targeted file outside the intended temporary directory. The fix also hardened path checks for the file transmission medium.

Exploitability

The CVSS vector CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N indicates local attack vector, high attack complexity, no privileges required, user interaction required, and high integrity impact with no confidentiality or availability impact. EPSS score is not yet available, and the vulnerability is not listed in CISA Known Exploited Vulnerabilities, so active exploitation is not documented.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
crates.io rio-vt >= 0.0.0-0, < 0.5.29 0.5.29 cargo update -p rio-vt --precise 0.5.29

CVSS 3.1 vector

CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N

Attack vectorLocal
Attack complexityHigh
Privileges requiredNone
User interactionRequired
ScopeUnchanged
ConfidentialityNone
IntegrityHigh
AvailabilityNone

FAQ

Which versions of `rio-vt` are affected?

All versions from 0.0.0-0 up to but not including 0.5.29 are affected. The vulnerability was fixed in version 0.5.29.

Does this vulnerability affect the direct file transmission medium as well?

The described flaw specifically affects the temp-file transmission medium. However, the fix in version 0.5.29 also hardened path checks for the file medium to run on the file actually opened.

Is there a workaround without upgrading?

No workaround is documented in the vulnerability record. The only remediation is upgrading to `rio-vt` 0.5.29 or later.

Original advisory description
The Kitty graphics protocol handler in `rio-vt` builds a filesystem path from an attacker-controlled APC escape sequence and, for the temp-file medium, only checks that the path *contains the substring* `"tty-graphics-protocol"` before it opens, reads, and `remove_file`s it. There is no `..` rejection and no canonicalization, so a path containing the marker substring plus `..` escapes the terminal's temp directory (path traversal, CWE-22/CWE-23). Because a terminal renders whatever arrives on the PTY (ssh output, a `cat`'d file, CI logs), untrusted output can delete a file outside the temp area and cause its bytes to be read back in. ## Details The sink is `create_graphic_data()` in `src/ansi/kitty_graphics_protocol.rs`, in the `TransmissionMedium::TempFile` branch, reachable through the public API `rio_vt::ansi::kitty_graphics_protocol::parse`. The path is the base64 APC payload of an `a=t,t=t` command, and the guard is: ```rust let path = Path::new(path_str); if !path.is_file() { return Err(GraphicError::FileNotFound); } // literal path, resolves `..` // reject /proc/ /sys/ /dev/ (lowercased substring) if cmd.medium == TransmissionMedium::TempFile && !path_str.contains("tty-graphics-protocol") { // SUBSTRING, not a component return Err(GraphicError::InvalidData); } // ... let mut file = File::open(path)...; // reads file bytes if cmd.medium == TransmissionMedium::TempFile { let _ = std::fs::remove_file(path); // deletes the file } ``` This affects any terminal emulator or application built on `rio-vt` (e.g. the Rio terminal) that renders attacker-influenced output: an out-of-bounds file is deleted, and its contents are read into the process. ## The fix Fixed in `rio-vt` 0.5.29 (Rio 0.5.29) by [PR #1998](https://github.com/raphamorim/rio/pull/1998). For the temp-file medium the parent directory is resolved with `canonicalize` before any check, the resolved entry must lie inside a temp directory (`temp_dir()`, `/tmp` or `/dev/shm`) and contain the marker, and the delete goes through `unlinkat` on a handle to the validated directory, so neither `..` nor a swapped symlink can redirect it. Path checks for the file medium also run on the file actually opened.

References

Source records: RUSTSEC-2026-0430 (OSV.dev).