Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 219750
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Matt Fleming (RETIRED) <mjf@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
mrxvt-0.5.3-display-security.patch Patch fixing the security issue patch Gautam Iyer 2008-04-29 20:50 0000 1.91 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 219750 depends on: Show dependency tree
Bug 219750 blocks:

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2008-04-29 19:28 0000
mrxvt-0.5.3 is vulnerable to the same X11 Display issue as rxvt,

"The security issue is caused due to the program using ":0" as it's X11 display
if the DISPLAY environment variable is missing. This can be exploited to
execute arbitrary commands with the privileges of the user running rxvt via a
malicious X server."

rxvt bug #217819

------- Comment #1 From Matt Fleming (RETIRED) 2008-04-29 19:29:45 0000 -------
Setting whiteboard and cc.

------- Comment #2 From Krzysiek Pawlik 2008-04-29 19:40:46 0000 -------
Adding Gautam Iyer, as he is an upstream for mrxvt and has account here.

Gautam: could you check out the patch in bug #217819 and provide new version of
mrxvt?

------- Comment #3 From Gautam Iyer 2008-04-29 20:50:15 0000 -------
Created an attachment (id=151368) [details]
Patch fixing the security issue

Here's the patch (now in SVN).

This patch will have (almost) no effect unless the LOCAL_X_IS_UNIX flag is
defined in src/feature.h. When this flag is defined, mrxvt will force a "unix:"
to be prepended to (local) display strings passed to the X server.

If this flag is not defined, then mrxvt will use the -display option unchanged,
or pass NULL to XOpenDisplay(), letting the server get the display from the
environment. (If display is undefined, mrxvt will exit). This is what happens
with most X programs on my currently installed Gentoo laptop.

I'm a little reluctant to #define LOCAL_X_IS_UNIX by default. It might break
something for someone. Would it be possible for you to #define LOCAL_X_IS_UNIX
based on some USE flag? I don't know if "hardened" is appropriate, since that
doesn't necessarily mean that the X server will like "unix:0.0" displays. I
also notice that most other X programs don't care about this. (They either pass
NULL, or the display option verbatim to XOpenDisplay() ).

GI

------- Comment #4 From Krzysiek Pawlik 2008-04-30 07:02:04 0000 -------
(In reply to comment #3)
> Here's the patch (now in SVN).

Great :) Thank you for fast response.

> I'm a little reluctant to #define LOCAL_X_IS_UNIX by default. It might break
> something for someone. Would it be possible for you to #define LOCAL_X_IS_UNIX
> based on some USE flag? I don't know if "hardened" is appropriate, since that
> doesn't necessarily mean that the X server will like "unix:0.0" displays. I
> also notice that most other X programs don't care about this. (They either pass
> NULL, or the display option verbatim to XOpenDisplay() ).

I have left it undefined for now. That way mrxvt will rely on X server to take
care of DISPLAY string, so if user wants to shoot his foot he can do it.


Security: x11-terms/mrxvt-0.5.3-r2 added to the tree, target KEYWORDS="alpha
amd64 ~mips ppc x86", as 0.5.3-r2 has only the above patch in comparison with
0.5.2-r1 the stabilization should be an easy one.

Testing procedure:
 * open xterm
 * start mrxvt from xterm - should open on same display
 * unset DISPLAY in xterm
 * try to start mrxvt, it should fail with: "Error opening display (null)"

------- Comment #5 From Gautam Iyer 2008-04-30 07:37:17 0000 -------
(In reply to comment #4)
>> I'm a little reluctant to #define LOCAL_X_IS_UNIX by default. It
>> might break something for someone. Would it be possible for you to
>> #define LOCAL_X_IS_UNIX based on some USE flag? I don't know if
>> "hardened" is appropriate, since that doesn't necessarily mean that
>> the X server will like "unix:0.0" displays. I also notice that most
>> other X programs don't care about this. (They either pass NULL, or
>> the display option verbatim to XOpenDisplay() ).
> 
> I have left it undefined for now. That way mrxvt will rely on X server to take
> care of DISPLAY string, so if user wants to shoot his foot he can do it.

Ok. I realize that the original reporter meant something slightly
different: If DISPLAY is unset (or unusable) then mrxvt used to connect
to :0.0 by default. Thus if you have a malicious X server, it can fool
the user into connecting to the wrong one.

It didn't seem much of an issue to me. X server's are usually suid root.
They don't need to fool anyone into connecting to do something
malicious...

Either way, this is not an issue now. 

> Security: x11-terms/mrxvt-0.5.3-r2 added to the tree, target KEYWORDS="alpha
> amd64 ~mips ppc x86", as 0.5.3-r2 has only the above patch in comparison with
> 0.5.2-r1 the stabilization should be an easy one.

Thanks for the updated ebuild,

GI

------- Comment #6 From Christian Hoffmann 2008-05-03 13:55:27 0000 -------
Arches, please test and mark stable (as noted in comment #4)
x11-terms/mrxvt-0.5.3-r2
Target keywords: alpha amd64 ~mips ppc x86
Already stabled: amd64

------- Comment #7 From Christian Faulhammer 2008-05-03 15:41:54 0000 -------
x86 stable

------- Comment #8 From Raúl Porcel 2008-05-04 09:48:12 0000 -------
alpha stable

------- Comment #9 From Tobias Scherbaum 2008-05-06 17:38:22 0000 -------
ppc stable

------- Comment #10 From Tobias Heinlein 2008-05-07 18:59:39 0000 -------
GLSA 200805-03

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug