X.Org security advisory: root hole via rogue hostname
From: | Matthias Hopf <mhopf-AT-suse.de> | |
To: | xorg-announce-AT-lists.freedesktop.org | |
Subject: | [ANNOUNCE] X.Org security advisory: root hole via rogue hostname | |
Date: | Tue, 5 Apr 2011 18:53:26 +0200 | |
Message-ID: | <20110405165326.GA1986@suse.de> | |
Cc: | xorg-AT-lists.freedesktop.org | |
Archive‑link: | Article |
X.Org security advisory, April 5th, 2011 root hole via rogue hostname CVE ID: CVE-2011-0465 Overview -------- By crafting hostnames with shell escape characters, arbitrary commands can be executed in a root environment when a display manager reads in the resource database via xrdb. These specially crafted hostnames can occur in two environments: * Hosts that set their hostname via DHCP * Hosts that allow remote logins via xdmcp Impact ------ Arbitrary (short) commands can be executed as root on affected hosts. With some display managers a working login is required (resource database is read upon login), with others no working login is required (resource database is read upon display manager start as well). Only systems are affected that 1) set their hostname via DHCP, and the used DHCP client allows setting of hostnames with illegal characters or 2) allow remote logins via xdmcp 1) requires either physical access to the network, or administrative access to the running DHCP server. 2) does not require physical access, if a regular account on a machine accepted by xdmcp is available, but describes a case that is considered insecure nowadays. Affected versions ----------------- xrdb up to including 1.0.8 X11R7.6 (latest release) includes xrdb 1.0.7 Fix --- This issue has been fixed with git commit 1027d5df07398c1507fb1fe3a9981aa6b4bc3a56 http://cgit.freedesktop.org/xorg/app/xrdb/commit/?id=1027... A fix of this vulnerability is included in xrdb 1.0.9. This issue was found by Sebastian Krahmer from the SUSE security team. Thanks Matthias Hopf <mhopf@suse.de> _______________________________________________ xorg-announce mailing list xorg-announce@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/xorg-announce
Posted Apr 5, 2011 20:29 UTC (Tue)
by SEJeff (guest, #51588)
[Link] (5 responses)
Posted Apr 5, 2011 22:27 UTC (Tue)
by acoopersmith (subscriber, #72107)
[Link] (1 responses)
Posted Apr 6, 2011 6:27 UTC (Wed)
by wahern (subscriber, #37304)
[Link]
But that only solves one of the two issues. You still need root to setuid(). But OpenSSH, for example, uses a multiple process model to isolate the privileged process; and it's the unprivileged process that does network I/O. Theoretically XDM could be setup similarly, so that only an unprivileged fork runs all the startup rc code and interacts with the environment, asking the privileged process to create a new user session when necessary. AFAIK the OpenBSD folks haven't hacked XDM to do this, but they use this multi-process model for all of their new services that require preservation of root credentials (excepting simple authentication, which is solved by BSDAuth).
Posted Apr 6, 2011 9:25 UTC (Wed)
by gowen (guest, #23914)
[Link] (2 responses)
'rm -rf $HOME/*'
it can do severe damage to me (modulo backups), and I don't care that it can't
'rm -rf /'
Posted Apr 6, 2011 11:47 UTC (Wed)
by Karellen (subscriber, #67644)
[Link]
Further, any exploit could do
"rm -rf /"
The one owned by you instead of root will end up doing the exact equivalent of
"rm -rf $HOME/*"
plus probably a bit more damage, even though it can't delete your whole system. The advantage is that it's limited to *only* your files, and not the whole system.
Also, the files which you care about, and are readable and writeable by you, are not the files which anyone else who uses that computer cares about, e.g. partner, kids, guests. So if you manage to get exploited and all your files are deleted, that's still a win for e.g. your partner. More importantly to you, if your partner gets exploited, all *your* files are still safe.
Finally, it's easier to restore just your home dir from backup than it is to reformat, reinstall your whole OS, including packaged applications (do you have a backup not only of /home, but also a list of which packages were installed, and all your changes to /etc?) and then anything you might have manually put in /usr/local, and *then* restore your home dir from backup.
This is why kernel mode settings + running X as an unprivileged user *will* be a blessing.
Posted Apr 6, 2011 12:17 UTC (Wed)
by SEJeff (guest, #51588)
[Link]
Posted Apr 6, 2011 0:52 UTC (Wed)
by Hausvib6 (guest, #70606)
[Link] (1 responses)
Posted Apr 6, 2011 4:56 UTC (Wed)
by branden (guest, #7029)
[Link]
Posted Apr 6, 2011 5:07 UTC (Wed)
by mikachu (guest, #5333)
[Link] (6 responses)
Posted Apr 6, 2011 6:57 UTC (Wed)
by daniels (subscriber, #16193)
[Link] (4 responses)
Posted Apr 6, 2011 7:39 UTC (Wed)
by osma (subscriber, #6912)
[Link] (3 responses)
Posted Apr 6, 2011 11:00 UTC (Wed)
by JanC_ (guest, #34940)
[Link] (1 responses)
Posted Apr 6, 2011 11:14 UTC (Wed)
by daniels (subscriber, #16193)
[Link]
Posted Apr 7, 2011 7:00 UTC (Thu)
by Gollum (guest, #25237)
[Link]
Posted Apr 6, 2011 9:12 UTC (Wed)
by mikachu (guest, #5333)
[Link]
$ xrdb -I'.;echo hello > nice;:' -n .Xdefaults >& /dev/null; cat nice
Also, what a great idea to replace random characters in user input with underscores. Why shouldn't I be allowed to include a dir called *~$;foobar? (Note that this faulty function isn't used for the hostname stuff which the vuln was about though.)
Posted Apr 6, 2011 13:59 UTC (Wed)
by nkttm (guest, #74115)
[Link]
static void
So, the same problem will be here:
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
X.Org security advisory: root hole via rogue hostname
hello
X.Org security advisory: root hole via rogue hostname
-AddSimpleDef(String *buff, char *title)
+AddDefTok(String *buff, char *prefix, char *title)
{
- AddDef(buff, title, (char *)NULL);
+ char name[512];
+
+ snprintf(name, sizeof(name), "%s%s", prefix, title);
+ AddSimpleDef(buff, name);
}
AddDefTok(defs, "CLNT_", client);