Security vulnerability: tty injection via sudo
This document (000021241) is provided subject to the disclaimer at the end of this document.
Environment
Situation
In cases where untrusted code using e.g. "sudo" is executed, the untrusted code could push keypresses into the TTY stack, which could then be executed after the sudo execution finishes.
While commonly sudo is used for transitioning to "root" where this would not be a problem, multiple other sudo scenarios are possible where this could be used to escalate privileges.
The untrusted code would then be able to execute commands as root using this attack.
To avoid this injection, sudo has the option to create a new pseudo terminal device (PTY), which is discarded after running sudo and then would not be affected by this keypress push back attack.
Please note that this might impact terminal output or use of interactive keys like backspace/delete.
Resolution
Default use_pty
to the /etc/sudoers configuration file using the visudo command.
Starting with sudo version 1.9.14p1 this setting is the default for new installations.
Status
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000021241
- Creation Date: 18-Oct-2023
- Modified Date:19-Oct-2023
-
- SUSE Linux Enterprise Desktop
- SUSE Linux Enterprise Server
- SUSE Linux Enterprise Server for SAP Applications
- SUSE Manager Server
- SUSE Linux Enterprise Micro
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com