`openvt -u` предназначен для идентификации владельца текущего VT, а затем выполнения `login` от имени этого пользователя из привилегированного контекста. В документированном использовании `kbrequest`/init проверка владения в `authenticate_user()` опирается на `stat("/proc/<pid>/fd/0")`. `stat()` в `/proc/<pid>/fd/0` следует по символической ссылке на базовый узел устройства TTY. В результате `buf.st_uid` отражает владельца узла TTY, а не владельца процесса, содержащего дескриптор файла.
Если владелец TTY возвращается к root или владельцу getty после выхода из системы, в то время как непривилегированный процесс все еще имеет fd 0, прикрепленный к этому TTY, проверка может неправильно считать этот процесс принадлежащим привилегированному владельцу консоли. Как только эта проверка завершится успешно, путь `-u` выполняет вход без пароля от имени выбранного пользователя. В документированном развертывании kbrequest/init с использованием openvt -us это может привести к беспарольному входу -f root на порожденном VT.
Этот отчет устанавливает путь повышения привилегий для этого документированного развертывания; он не претендует на эквивалентную доступность для развертываний, которые не используют `openvt -u` из привилегированного пути `kbrequest`/init.
Показать оригинальное описание (EN)
`openvt -u` is intended to identify the owner of the current VT and then execute `login` as that user from a privileged context. In the documented `kbrequest`/init usage, the ownership test in `authenticate_user()` relies on `stat("/proc/<pid>/fd/0")`. `stat()` on `/proc/<pid>/fd/0` follows the symlink to the underlying TTY device node. As a result, `buf.st_uid` reflects the owner of the TTY node rather than the owner of the process holding the file descriptor. If the TTY owner returns to `root` or the getty owner after logout while an unprivileged process still has `fd 0` attached to that TTY, the check can incorrectly treat that process as belonging to the privileged console owner. Once that check succeeds, the `-u` path executes a passwordless login as the selected user. In the documented `kbrequest`/init deployment using `openvt -us`, this can result in passwordless `login -f root` on the spawned VT. This report establishes that privilege escalation path for that documented deployment; it does not claim equivalent reachability for deployments that do not use `openvt -u` from a privileged `kbrequest`/init path.
Характеристики атаки
Последствия
Строка CVSS v3.1