Bug 413721 - (CVE-2007-6429) CVE-2007-6429 xorg / xfree86: integer overflow in EVI extension
CVE-2007-6429 xorg / xfree86: integer overflow in EVI extension
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Red Hat Product Security
source=vendorsec,reported=20071204,pu...
: Security
Depends On: 419451 419461 419481 419501 419521 419531 429125 429126 429127
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-06 05:29 EST by Tomas Hoger
Modified: 2016-06-17 17:05 EDT (History)
6 users (show)

See Also:
Fixed In Version: 1.3.0.0-39.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-22 10:31:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomas Hoger 2007-12-06 05:29:12 EST
iDefense reported a vulnerability discovered by regenrecht affecting Xorg X server:

DESCRIPTION

Local exploitation of an integer overflow vulnerability in the X.Org X
server, as included in various vendors' operating system distributions,
could allow an attacker to execute arbitrary code with the privileges of
the X server, typically root.

The vulnerability exists within the code responsible for processing the
GetVisualInfo request. When processing this request, the server uses a
32-bit value provided by the client in an arithmetic operation that
calculates the number of bytes to allocate for a dynamic buffer. This
operation can overflow, which later leads to the buffer being
overflowed.

The vulnerable code is shown below:

From Xext/EVI.c:ProcEVIGetVisualInfo()

94  REQUEST_FIXED_SIZE(xEVIGetVisualInfoReq, stuff->n_visual *sz_VisualID32);

95  status = eviPriv->getVisualInfo((VisualID32 *)&stuff[1], (int)stuff->n_visual,

96   &eviInfo, &n_info, &conflict, &n_conflict);

From Xext/sampleEVI.c:sampleGetVisualInfo()

45  int max_sz_evi = n_visual * sz_xExtendedVisualInfo *
screenInfo.numScreens;

...

50  *evi_rn = evi = (xExtendedVisualInfo *)xalloc(max_sz_evi);

...

63  for (scrI = 0; scrI < screenInfo.numScreens; scrI++) {

64   for (visualI = 0; visualI < n_visual; visualI++) {

65     evi[sz_evi].core_visual_id = visual[visualI];

On lines 95-96, several client controlled values are passed to the
sampleGetVisualInfo() function. On line 45, these values are multiplied
together, and on line 50 the result is passed to xalloc() to allocate a
buffer. In lines 63-65, this buffer is overflowed.

ANALYSIS

Exploitation allows an attacker to execute arbitrary code with root
privileges. In order to exploit this vulnerability, an attacker must be
able to send commands to an affected X server. This typically requires
access to the console or access to the same account as a user who is on
the console. One method of gaining the required access is to remotely
exploit a vulnerability in, for example, a graphical web browser. This
would then allow an attacker to exploit this vulnerability and elevate
their privileges to root.

If an X Server is configured to listen for TCP based client connections,
and a client is granted access to create sessions (via the xhosts file),
then the vulnerability can be exploited remotely.

WORKAROUND

If the EVI extension has not been built-in to the server, then it can be
prevented from loading by inserting the following into the X
configuration file (usually in /etc/X11/xorg.conf):

Section "Module"

        SubSection "extmod"

                Option "omit Extended-Visual-Information"

        EndSubSection

EndSection

To check if the extension is built-in to the server, grep the output of
the X Server log file:

grep built-in /var/log/Xorg.0.log

The result will list all built in extensions. The location of the log
file may need to be changed.
Comment 1 Tomas Hoger 2007-12-06 05:46:50 EST
Upstream bug report:

  https://bugs.freedesktop.org/show_bug.cgi?id=13519
Comment 7 Tomas Hoger 2008-01-02 02:24:19 EST
CVE id CVE-2007-6429 is used to cover integer overflows in both EVI and MIT-SHM
extensions.

MIT-SHM extension issue is tracked via bug #413741.
Comment 14 Josh Bressers 2008-01-17 09:43:02 EST
Lifting embargo:
http://lists.freedesktop.org/archives/xorg/2008-January/031918.html
Comment 16 Mark J. Cox (Product Security) 2008-01-18 12:03:48 EST
There have been reports from other distributions that the fix for this issue
causes problems with some applications.  See for example: 

https://bugs.launchpad.net/ubuntu/+bug/183969
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461410

Our engineers are currently investigating this issue.  It is currently believed
that a work-around that can be used with these new packages is to disable the
mitshm extension, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461410#26

Comment 17 Mark J. Cox (Product Security) 2008-01-18 16:00:05 EST
Status update:

Our engineers have a patch for this issue.  Updated packages are being built and
will go through an expedited process for release as soon as they are ready.  As
the patches were security complete, the updated patches do not fix a security
regression.  As such we intend to release the updated packages in their original
RHSA errata with a bumped advisory revision.
Comment 18 Mark J. Cox (Product Security) 2008-01-19 04:36:02 EST
[Updated 18th January 2008]
The original packages distributed with this errata had a bug which could
cause some X applications to fail on 32-bit platforms. We have updated the
packages to correct this bug.

http://rhn.redhat.com/errata/RHSA-2008-0031.html
http://rhn.redhat.com/errata/RHSA-2008-0030.html
http://rhn.redhat.com/errata/RHSA-2008-0029.html
Comment 19 Fedora Update System 2008-01-22 10:31:35 EST
xorg-x11-server-1.3.0.0-39.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 20 Fedora Update System 2008-01-22 10:49:07 EST
xorg-x11-server-1.3.0.0-15.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.