Bugzilla – Bug 121922
VUL-0: xloadimage/xli: buffer overflow
Last modified: 2009-10-13 21:40:20 UTC
this is a report about xloadimgae (which we seem not to ship) but the bugs
should also affect xli.
Subject: xloadimage buffer overflow.
Date: Wed, 5 Oct 2005 16:27:57 -0500
[-- Anhang #1 --]
[-- Typ: text/plain, Kodierung: 7bit, GrÃ¶Ãe: 2,4K --]
While creating a stripped down version of xloadimage, I have discovered
three buffer overflows in xloadimage when handling the image title name.
Unlike most of the supported image formats in xloadimage, the NIFF image
format can store a title name of arbitrary length as part of the image file.
When xloadimage is processing a loaded image, it is creating a new Image
object and then writing the processed image to it. At that point, it will
also copy the title from the old image to the newly created image.
The 'zoom', 'reduce', and 'rotate' functions are using a fixed length buffer
to construct the new title name when an image processing is done. Since the
title name in a NIFF format is of varying length, and there are insufficient
buffer size validations, the buffer can be overflowed.
A malicious user can construct a NIFF file that when viewed and processed
(with either zoom, reduce or rotate) by xloadimage, will cause the program
to overwrite the return address and execute arbitrary code.
Proof of concept for the 'zoom' image processing bug, tested on a x86
computer running Gentoo Linux:
xloadimage -zoom 20 small.niff (small.niff is attached)
This will execute '/bin/sh'.
Note: some systems may have the (/proc/sys/kernel/)randomize_va_space option
enabled, which will cause the program to crash instead of executing /bin/sh
in most cases. Using a larger NIFF file (large.niff.gz [800KB unzipped]), it
is possible to execute arbitrary code even when the random address space
option is enabled (with about 33% success rate).
The 'reduce' and 'rotate' bugs are similar, but require a slightly different
NIFF file and different ( processing options.
The bugs are in :
zoom.c, zoom() writes an arbitrarily large buffer into a 8192 bytes sized
reduce.c, reduce() writes an arbitrarily large buffer into a 8192 bytes
sized buffer buf.
rotate.c, rotate() writes an arbitrarily large buffer into a 8192 bytes
sized buffer buf.
The bugs discussed above exist in the latest xloadimage package that Gentoo
provides (xloadimage.4.1-r3), and the latest xloadimage source package from
debian I could find (xloadimage_4.1-14.2). I haven't tested xloadimage
packages from other sources.
I emailed email@example.com (the contact information on the help page)
more than two weeks ago, but since I've recieved no reply, I am announcing
[-- Anhang #2: large.niff.gz --]
Created attachment 52071 [details]
Created attachment 52072 [details]
Reference: BUGTRAQ:20051005 xloadimage buffer overflow.
Buffer overflow in xloadimage 4.1 and earlier might allow
user-complicit attackers to execute arbitrary code via (1) a long
title name in a NIFF file, which triggers the overflow during (1)
zoom, (2) reduce, or (3) rotate operations.
I will look at it.
I'm not sure if this bug in xloadimage can affect xli.
Security team : Can you please enlighten this problem?
The link http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-3178 seemed to
Yes it is indeed broken. Maybe due to the database change.
Please have a look at this Debian advisory:
Debian Security Advisory DSA 859-1 firstname.lastname@example.org
http://www.debian.org/security/ Martin Schulze
October 10th, 2005 http://www.debian.org/security/faq
Package : xli
Vulnerability : buffer overflows
Problem type : local (remote)
CVE ID : CAN-2005-3178
Debian Bug : 332524
Ariel Berkman discovered several buffer overflows in xloadimage, which
are also present in xli, a command line utility for viewing images in
X11, and could be exploited via large image titles and cause the
execution of arbitrary code.
For the old stable distribution (woody) these problems have been fixed in
For the stable distribution (sarge) these problems have been fixed in
For the unstable distribution (sid) these problems will be fixed soon.
We recommend that you upgrade your xli package.
will fetch the file for you
dpkg -i file.deb
will install the referenced file.
If you are using the apt-get package manager, use the line for
sources.list as given below:
will update the internal database
will install corrected packages
You may use an automated update by adding the resources from the
footer to the proper configuration.
Debian GNU/Linux 3.0 alias woody
Size/MD5 checksum: 620 0276fa4de8addea1ba22891082860983
Size/MD5 checksum: 17956 71eaa54284c5a94cd1da8eeb84640158
Size/MD5 checksum: 200070 504f916c9a7d062c8f856f1625634ba8
Many thanks for info.
This problem was already partly fixed, but not completely. Submited for STABLE.
Do we want to get this fix also for SL 10.0?
Yes, for all affected versions >= SL 9.0 + SLES and derivates.
I have submited patched xli for these distributions:
xli 9.0-all /work/SRC/old-versions/9.0/all/xli /work/src/done/9.0
xli 9.1-all /work/SRC/old-versions/9.1/all/xli /work/src/done/9.1
xli 9.2-all /work/SRC/old-versions/9.2/all/xli /work/src/done/9.2
xli 9.3-all /work/SRC/old-versions/9.3/all/xli /work/src/done/9.3
xli 10.0-all /work/SRC/old-versions/10.0/all/xli /work/src/done/10.0
I assume that patchinfo and SWAMPID will provide security-team.
Yes.. 'll do so. Thanks.
updates approved, thanks!
CVE-2005-3178: CVSS v2 Base Score: 5.1 (AV:N/AC:H/Au:N/C:P/I:P/A:P)