Buffer overflow in xlock in UnixWare 7.1.0 and 7.1.1 and Open Unix 8.0.0 allows local users to execute arbitrary code.
Local privilege escalation is possible on vulnerable UnixWare and Open Unix systems due to a buffer overflow in the xlock program. Successful exploitation allows attackers to execute arbitrary code with the privileges of the user running xlock, potentially leading to complete system compromise.
Step 1: User Interaction: A local user, or an attacker with local access, interacts with the xlock program.
Step 2: Input Delivery: The attacker provides a specially crafted input string, likely through command-line arguments or configuration files used by xlock.
Step 3: Vulnerability Trigger: The crafted input is processed by xlock, triggering the buffer overflow in a vulnerable function.
Step 4: Memory Corruption: The malicious input overwrites a portion of memory, including the return address on the stack.
Step 5: Code Execution: When the vulnerable function returns, control is transferred to the attacker-controlled address (the shellcode).
Step 6: Privilege Escalation: The attacker's shellcode executes with the privileges of the user running xlock (typically the user's account).
Step 7: System Compromise: The attacker can then use the elevated privileges to further compromise the system, such as installing backdoors, stealing data, or gaining root access.
The vulnerability lies within the xlock program, specifically in how it handles user-supplied input related to display settings or configuration. The root cause is a buffer overflow, where a crafted input string, likely related to a display parameter or configuration option, is not properly bounds-checked before being written to a fixed-size buffer. This allows an attacker to overwrite adjacent memory locations, including potentially the return address on the stack. By overwriting the return address with the address of malicious code (shellcode), the attacker can redirect program execution to their code, achieving arbitrary code execution with the privileges of the user running xlock. The lack of proper input validation and bounds checking is the fundamental flaw.