Files
ghostty/src
Mitchell Hashimoto 0b54463649 terminal/kitty: reject unsafe Windows paths for image file mediums
The Kitty graphics file and temporary file mediums open a
client-supplied path and the Kitty specification only specifies the
blocklist for Unix-style machines.

Windows has various unsafe paths as well that we should very obviously
block. This diverges from the Kitty specification for now (I plan
on reporting this upstream and asking for feedback) but I think its the
right move for security.

Windows dangerous namespaces:

  - A UNC path (`\\server\share\x`, also `//server/share/x`) makes the 
    process resolve the host and authenticate to it over SMB.
  - The device namespaces (`\\.\`, `\\?\`, `\??\`) reach raw volumes and 
    named pipes, where the open connects to something or blocks.
  - Reserved DOS device names (CON, NUL, COM1, ...) resolve to devices 
    from inside any directory.

These are now blocked.

This commit also heap allocates the path buffer because max path on
windows is around 100KB. :)
2026-09-09 06:56:00 -07:00
..
2026-08-30 02:34:21 -06:00
2026-03-15 20:58:43 -04:00
2025-10-03 18:52:26 +02:00
2026-07-21 17:19:16 -07:00
2025-11-27 13:37:53 -08:00
2026-08-03 20:10:19 -07:00
2026-07-21 12:35:05 -07:00
2026-07-21 17:19:16 -07:00
2026-07-21 12:35:05 -07:00
2026-07-21 17:19:16 -07:00
2026-07-21 17:19:16 -07:00
2024-08-16 14:35:10 -07:00
2026-07-21 17:19:16 -07:00
2022-08-18 11:42:32 -07:00
2026-03-20 10:37:42 -05:00
2026-07-21 12:35:05 -07:00
2026-08-31 15:07:11 +03:00
2026-07-21 12:35:05 -07:00