Bug 196094
| Summary: | Potential X insecure suid calls | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Mike A. Harris <mharris> |
| Component: | xorg-x11 | Assignee: | Mike A. Harris <mharris> |
| Status: | CLOSED RAWHIDE | QA Contact: | David Lawrence <dkl> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | rawhide | CC: | security-response-team, xgl-maint |
| Target Milestone: | --- | Keywords: | Security |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2006-06-21 10:58:08 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 196126 | ||
|
Description
Mike A. Harris
2006-06-20 22:29:53 UTC
Here is the correct URL to the patches for X11R7.1, which is the release we have present in rawhide: ftp://ftp.freedesktop.org/pub/xorg/X11R7.1/patches xtrans-1.0.0-setuid.diff added to: xorg-x11-xtrans-devel-1.0.0-4 libX11-1.0.1-setuid.diff added to: libX11-1.0.1-3 xdm-1.0.4-setuid.diff added to: xorg-x11-xdm-1.0.4-3 xorg-xserver-1.1.0-setuid.diff added to: xorg-x11-server-1.1.0-21 xinit-1.0.2-setuid.diff added to: xorg-x11-xinit-1.0.2-3 xload-1.0.1-setuid.diff added to: xorg-x11-apps-7.1-1 The xf86dga client is not built or supplied in Fedora Core 5 and newer. [From bug 195555] Comment #6 From Josh Bressers (Security Response Team) (bressers) on 2006-06-22 14:00 EST [reply] Private This is not a secuirty issue. It turns out the places that the setuid is used are not controlable by an attacker. The upstream advisory mentions unchecked suid usage in several places. We only ship the Xorg executable suid root, which is the only potentially vulnerable program. Here is a listing of the bad setuid() calls (provided by Marcus Meissner of Suse). The analysis was done by me. ./programs/Xserver/hw/xfree86/common/xf86Init.c: setuid(getuid()); After this "sh -c "vtinit"" is called, which might be exploitable. We don't enable the vtinit command by default, nor would I expect anybody to be using this configuration option. Even if this ran as root it will rely on a very insecure and poor configuration file option. ./programs/Xserver/hw/xfree86/parser/write.c: setuid(getuid()); Could corrupt any file on the system, like /etc/shadow. Only when Xorg is run as root can this codepath be reached; the setuid is a bit silly. ./programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c: setuid(getuid()); In xf86execl(), which I do not know who calls it. (There are #define execl xf86execl in some files.) All calls to execl (that are dangerous) are preceded by a setuid call. They are the xf86Init.c call above, and the utils.c calls below. ./programs/Xserver/os/utils.c: setuid(getuid()); ./programs/Xserver/os/utils.c: setuid(getuid()); ./programs/Xserver/os/utils.c: setuid(getuid()); These are in Popen(), Fopen(), System(). The calls to Fopen should be safe. The server uses seteuid if it's there, otherwise it will fall back on setuid. (seteuid() is not vulnerable to this problem) The calls to Popen and System are used by the keyboard map loading bits of X. There is no way for a user to specify a keyboard file (There is a -kkbdb option which does nothing). I can specify an existing keyboard map (-kbmap), but the keymap file is verified and loaded long before the suid call happens. |