Skip to content
Heist/ feed
Medium

Use after free in the kitty drag and drop protocol when a drag source item is aborted mid-transfer

Type: advisorySource: Official CVE List1 source record

Use After Free in the drag source path of the drag and drop protocol in kitty from 0.47.0 before 0.49.0 allows a program writing to the terminal to cause the terminal to read from and write to freed heap memory, because drag_remote_file_data() in kitty/dnd.c holds a DragRemoteItem pointer into an array it does not own, calls toplevel_data_for_drag() or subdir_data_for_drag(), and then continues to use that pointer. Those helpers, and add_payload() and populate_dir_entries() which they call, report errors through the abrt() macro, which expands to cancel_drag() followed by a plain return, and cancel_drag() calls drag_free_offer(), which frees the array the pointer refers to. The helpers return void, so the caller receives no indication that the teardown happened, and proceeds to call all_children_complete() on the freed pointer, which dereferences it, and then to write through it. That dereference is guarded by a local flag that is set when the request carries no payload and announces no further data, which is the same condition that selects the finalisation block of add_payload(), so the error paths in that block reach it: a create that fails because an entry of the same name already exists, because the client may declare two entries with one name and the create operations use O_CREAT with O_EXCL and symlinkat(), a mkdirat() failure other than EEXIST, and the directory entry allocation paths. Both branches reach it. In the top level branch the caller's pointer is never cleare

Announced Source revision 1
Original source ↗

CVE-2026-95834

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2026-95834

kitty

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "repo": "https://github.com/kovidgoyal/kitty",
    "vendor": "Kovid Goyal",
    "product": "kitty",
    "versions": [
      {
        "status": "affected",
        "version": "0.47.0",
        "lessThan": "0.49.0",
        "versionType": "semver"
      }
    ],
    "programFiles": [
      "kitty/dnd.c"
    ],
    "defaultStatus": "unaffected"
  }
]
Related CVEs
CVE-2026-95834

Source reference: /cveMetadata/cveId

Publisher severity

medium

Source reference: /containers/cna/metrics

Event
#2195 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement