[UNIX] Arbitrary Command Executing on Query of Corrupt RPM Files
From: support@securiteam.comDate: 10/28/01
- Previous message: support@securiteam.com: "[UNIX] Oracle Trace Collection Security Vulnerability"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: support@securiteam.com To: list@securiteam.com Subject: [UNIX] Arbitrary Command Executing on Query of Corrupt RPM Files Message-Id: <20011028072040.07706138BF@mail.der-keiler.de> Date: Sun, 28 Oct 2001 08:20:40 +0100 (CET)
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion
When was the last time you checked your server's security?
How about a monthly report?
http://www.AutomatedScanning.com - Know that you're safe.
- - - - - - - - -
Arbitrary Command Executing on Query of Corrupt RPM Files
------------------------------------------------------------------------
SUMMARY
It is possible to create an RPM (RedHat Package Management) file with
'corrupted' data that will cause arbitrary code to execute when the file
is queried. (e.g.: an rpm utility is used to gain information about the
contents of the file, such as version, build date etc, when checking the
file for corruptions against the stored MD5 sum, etc. )
Exploiting this bug would require the exploiter to know the location in
memory their shellcode will be stored in the heap, a value that is
sensitive to initial conditions, and get the rpm to be accessed.
NB: Due to the environment variable LESSOPEN (in RH7.0), calling a utility
that itself calls rpm, such as viewing an RPM file with 'less' is also
potentially dangerous. (i.e. 'less file.rpm' will call
/usr/bin/lesspipe.sh, which in turn calls rpm)
DETAILS
Vulnerable systems:
rpm version 4.0.2-7x
Probably also earlier 4.0.x rpm packages (*)
Also affects other programs using rpm 4.0.x libraries, including rpm2html.
(*) 3.0.x is not affected by this fault, but that does not mean it is not
affected by a similar problem. (Tested against RPM 3.0.3 on SuSE 6.2)
Workaround:
Do not even query files from untrusted sources.
(Running 'less file.rpm' will query the file, when using the default
settings)
Example:
This could be used in an Exploit to gain user lp:
1) Get an RPM file.
2) Modify its header so it will run your code.
3) Send it the printer on a RH 7.0 system.
4) Do what you were going to do as user lp.
1) Either make one yourself, or download one of the net.
2) The tricky part. Requires a modifying the header so it is still valid,
but will corrupt the heap in such a way as to cause execution of your
shellcode, which must also be loaded into memory, when the rpm is queried
by the print filter (see 3).
3) The RedHat print system will select the 'RPM to ASCII" print filter
(/usr/lib/rhs/rhs-printfilters/rpm-to-asc.fpi) to print information about
the RPM out. In the process of doing this, it queries the file.
4) Maybe Trojan any 'lp' owned files, so when they are run by another
user, it will create a suid shell, owned by them, in a place you can find,
while retaining functionality of the Trojaned programs.
ADDITIONAL INFORMATION
The information has been provided by <mailto:zen-parse@gmx.net>
zen-parse.
========================================
This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com
====================
====================
DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.
- Previous message: support@securiteam.com: "[UNIX] Oracle Trace Collection Security Vulnerability"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
- Re: Check RPM database?
... database is corrupt that I must do something about it, ... rpm database.
... Is there a tool or command to check the RPM database for being corrupt? ...
(Fedora) - Advisory: Corrupt RPM Query Vulnerability
... Subject: Advisory: Corrupt RPM Query Vulnerability ... Arbitrary command
executing on query of corrupt RPM files ... (Bugtraq) - Re: Segmentation fault
... it is regarding the rpm package..it may be corrupted.. ... Is this a hardware
or software problem? ... I am suspecting that this means I had a corrupt download. ...
(Fedora) - Re: corupted kernel
... Assuming you are correct and it is really corrupt (I doubt it but I have been ...
Boot into rescue mode and reinstall the kernel rpm. ... (Fedora) - Re: [SLE] apt error
... >> Which rpms are you upgrade? ... Reading Package Lists... ...
Executing RPM... ... (SuSE)