Home / exploits Linux pkexec / polkitd 0.96 Race Condition
Posted on 09 October 2011
#!/bin/sh <<COMMENT1 Exploit Title: Linux pkexec and polkitd 0.96 race condition privilege escalation Date: Sun Oct 9 00:31:10 WIT 2011 Author: Ev1lut10n About Ev1lut10n: http://jasaplus.com/ev1lut10n A Chinese Man Lives in Indonesia Software Link: http://pkgs.fedoraproject.org/repo/pkgs/polkit/polkit-0.96.tar.gz/e0a06da501b04ed3bab986a9df5b5aa2/ Version: 0.96 Tested on: 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:34:50 UTC 2010 i686 GNU/Linux under Gnome Environment CVE : CVE-2011-1485 Brief Descriptions src/polkit/polkitunixprocess.c where it fails to clarify the real uid, under this race condition it will return the effective one. on : polkit_unix_process_get_owner (PolkitUnixProcess *process, g_snprintf (procbuf, sizeof procbuf, "/proc/%d", process->pid); if (stat (procbuf, &statbuf) != 0) { g_set_error (error, POLKIT_ERROR, POLKIT_ERROR_FAILED, "stat() failed for /proc/%d: %s", process->pid, g_strerror (errno)); goto out; } where the code only rely on stat of the pseudo filesystem src/polkit/polkitsubject.c ---------> there's not enough validation to run polkit_unix_process_new on polkit_subject_from_string (const gchar *str, there's no enough validation before launching polkit_unix_process_new if (g_str_has_prefix (str, "unix-process:")) { val = g_ascii_strtoull (str + sizeof "unix-process:" - 1, &endptr, 10); if (*endptr == '
