Multiple Vendor BSD libutil pw_error() Format String Vulnerability

Libutil is a shared library used by almost every unix that contains code for "standard" functions used in many different unix untilities. The BSD libutil contains a format string vulnerability in the pw_error() function, used in the setuid chpass utility.

In pw_error(), user input is passed as the only argument to a *printf() function, making it possible for an attacker to corrupt the stack. If format specifiers are deliberately inserted into the string that is passed to the function, the *printf function will reference locations deeper into the stack than it should, expecting to see variables that would normally be there. This, combined with the fact that you can write to memory with format specifiers, allows an attacker to, for example, reconstruct the return address of the function so that it points to user-supplied (in the format string) shellcode. When the function returns, it will begin executing the shellcode on the stack.

Exploitation of this vulnerability leads to local root access for the attacker.


Privacy Statement
Copyright 2010, SecurityFocus