exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

SNI-07.X11_OVERFLOW.advisory

SNI-07.X11_OVERFLOW.advisory
Posted Sep 23, 1999

X11 overflow advisory..

tags | overflow
SHA-256 | 7a238bbd26cdb2336243ff97eb9c108c3efad875cf9215c85b0b51069da4f795

SNI-07.X11_OVERFLOW.advisory

Change Mirror Download
                        ######    ##   ##    ######
## ### ## ##
###### ## # ## ##
## ## ### ##
###### . ## ## . ######.

Secure Networks Inc.

Security Advisory
February 24, 1997

Environment Variable Problems in X11


While examining the differences between X11R6.1 and X11R6.3, it has come to
our attention that a number of serious security problems in libX11 were fixed
between releases. These problems permit unprivileged users to obtain elevated
access, including group sys, group kmem, and root privileges, depending on the
operating system and the X11 release. Administrators should be aware that
these problems are actively being exploited, and should take the precautions
outlined below to ensure they are not susceptible to these problems.


Technical Details
~~~~~~~~~~~~~~~~~

In X11R6.1 and earlier, there are many places where libX11 looks at
environment variables, and then performs string operations on them. X11R6.1
and earlier, however, perform no bounds checking when doing these string
operations. Setuid and setgid programs which use functions provided by libX11
may allow users to obtain elevated privileges.

One of the many examples of flawed code in X11R6.1, in this case from
GetDflt.c reads:

if (ptr = getenv("HOME"))
(void) strcpy(dest, ptr);

While the corrected code for this particular exammple in X11R6.3 reads:

if (ptr = getenv("HOME")) {
(void) strncpy(dest, ptr, len);
dest[len-1] = '\0';

Note that this code correctly adds a null character at the end of the
string after the strncpy.


Impact
~~~~~~
Depending on platform and X11 release, individuals with shell access can
obtain elevated access, including group sys, group kmem, and root
privileges.


Vulnerable Systems
~~~~~~~~~~~~~~~~~~
Any system which is running X11R6.1 or earlier, and has at least one setuid or
setgid program which uses libX11 is vulnerable.

You can perform a simple test to determine whether your system is vulnerable.
First, set the HOME environment variable to a string at least 2500 characters
long. Using a sh compatible shell, do this by issuing the commands:

$ HOME=jjjjjjj...jjjjj (2500 repititions of 'j')
$ export HOME

Using csh or tcsh, use the command:

% setenv HOME jjjjj...jjjjjjj (2500 repititions of 'j')

Then, run a setuid or setgid X program, such as xload. If you are running a
vulnerable release of X11, you will get an error message including either the
words "Segmentation Fault" or "Bus error." If the words "Segmentation Fault"
and "Bus Error" do not appear, and the program operates correctly, you are not
vulnerable to this problem.

Be aware that if you use a string much shorter than 2500 characters, this test
will not produce meaningful results, because the length of the buffer in
question is 2048 characters. Also, if your DISPLAY environment variable does
not point to a display which you have authorization to connect to, the test
will not be able to connect to a valid display and therefore will not work.


Fix Information
~~~~~~~~~~~~~~~
To fix these problems without loss of functionality, upgrade to the current
release of X11. You can obtain X11R6.3 by referring to
http://www.x.org/consortium/GettingX.html

As an alternative workaround, administrators may want to remove setuid and
setgid bits from vulnerable programs. To find all setuid and setgid programs,
in the X11 distribution, the following command can be executed:

% cd /usr/X11/bin
% find . \( -perm -02000 -o -perm -04000 \) -exec ls -l {} \;
% find . \( -perm -02000 -o -perm -04000 \) -exec chmod ug-s {} \;

Remember to perform the same command if you wish to remove permissions from
programs stored in other system directories. Keep in mind that that the
use of this workaround will result in reduced functionality for non-root
users.


Additional Information
~~~~~~~~~~~~~~~~~~~~~~

If you have any questions about this advisory, feel free to contact me,
David Sacerdote, at davids@secnet.com. If you should wish to encrypt
traffic for me, my pgp key is:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAzJ4qJAAAAEEAOgB7mooQ6NgzcUSIehKUufGsyojutC7phVXZ+p8FnHLLZNB
BLQEtj5kmfww2A2pR29q4rgPeqEUOjWPlLNdSLby3NI8yKz1AQSQLHAwIDXt/lku
8QXClaV6pNIaQSN8cnyyvjH6TYF778yZhYz0mwLqW6dU5whHtP93ojDw1UhtAAUR
tCtEYXZpZCBTYWNlcmRvdGUgPGRhdmlkc0BzaWxlbmNlLnNlY25ldC5jb20+
=LtL9
-----END PGP PUBLIC KEY BLOCK-----

Many thanks to the unknown individual who undertook to fix this set
of holes in the final days of the X Consortium.

Additional information about the X Windowing System can be found at
http://www.x.org

You can find Secure Networks papers at ftp://ftp.secnet.com/pub/papers
and advisories at ftp://ftp.secnet.com/advisories

You can browse our web site at http://www.secnet.com

You can subscribe to our security advisory mailing list by sending mail to
majordomo@secnet.com with the line "subscribe sni-advisories" in the body of
the message.


Copyright Notice
~~~~~~~~~~~~~~~~
The contents of this advisory are Copyright (C) 1997 Secure Networks Inc,
and may be distributed freely provided that no fee is charged for
distribution, and that proper credit is given.

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close