Ad

CVE-2026-95834

MEDIUM CVSS 4.0: 4,6 EPSS 0.13%
Обновлено 30 сентября 2026
Payload
Параметр Значение
CVSS 4,6 (MEDIUM)
Уязвимые версии 0.47.0 — 0.49.0
Устранено в версии 0.49.0
Тип уязвимости CWE-416 (Использование памяти после освобождения)
Поставщик Payload
Публичный эксплойт Нет

Использование After Free в траектории перетаскивания протокола перетаскивания из 0.47.0 до 0.49.0 позволяет программе, пишущей в терминал, заставлять терминал читать и записывать в свободную кучу памяти, потому что drag_remote_file_data () в kitty/dnd.c содержит указатель DragRemoteItem в массиве, которым он не владеет, вызывает toplevel_data_for_drag () или subdir_data_for_drag (), а затем продолжает использовать этот указатель. Эти помощники, а также вызываемые ими add_payload() и populate_dir_entries(), сообщают об ошибках через макрос abrt(), который расширяется до cancel_drag(), за которым следует простой возврат, и cancel_drag() вызывает drag_free_offer(), который освобождает массив, на который ссылается указатель. Помощники возвращают пустоту, поэтому вызывающий абонент не получает никаких указаний на то, что произошел разрыв, и переходит к вызову all_children_complete () на освободившемся указателе, который отбрасывает его, а затем записывает через него.

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. До него доходят обе ветви. В ветке верхнего уровня указатель вызова никогда не очищается, поэтому очистка собственных указателей собственной структуры во время разборки не помогает.

В ветке подкаталога subdir_data_for_drag() устанавливает указатель вызывающего абонента на NULL при входе и назначает его только после его собственного последнего пути ошибки, поэтому его собственные прерывания оставляют вызывающего абонента с NULL и останавливаются нулевой проверкой, но затем он вызывает add_payload() с этим набором указателей, и прерывание там оставляет вызывающего абонента держащим освобожденный дочерний узел внутри дерева элементов, которое drag_free_offer() освобождается путем повторения. Это приводит к неопределенному поведению в терминальном процессе, достижимому из потока байтов любой программы, выполняющейся в окне.

Показать оригинальное описание (EN)

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 cleared, so clearing the owning structure's own pointers during teardown does not help. In the sub directory branch subdir_data_for_drag() sets the caller's pointer to NULL on entry and assigns it only after its own last error path, so its own aborts leave the caller with NULL and are stopped by a null check, but it then calls add_payload() with that pointer set, and an abort there leaves the caller holding a freed child node inside the item tree, which drag_free_offer() frees by recursion. This results in undefined behaviour in the terminal process, reachable from the byte stream of any program running in the window.

Характеристики атаки

Способ атаки
Локальный
Нужен локальный доступ
Сложность
Низкая
Легко эксплуатировать
Условия для атаки
Не требуются
Нет дополнительных условий
Нужны права
Не требуются
Права не нужны
Участие пользователя
Активное
Нужно действие пользователя

Последствия

Конфиденциальность
Нет
Нет утечки данных
Целостность
Низкое
Частичная модификация данных
Доступность
Низкое
Частичное нарушение работы

Строка CVSS v4.0

Уязвимые продукты 1

Конфигурация От (включительно) До (исключительно)
Kovidgoyal Kitty
cpe:2.3:a:kovidgoyal:kitty:*:*:*:*:*:*:*:*
0.47.0 0.49.0