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

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

           ESB-2004.0253 -- iDEFENSE Security Advisory 04.05.04
          Perl win32_stat Function Buffer Overflow Vulnerability
                               06 April 2004

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

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

Product:                Perl 5.8.3 and prior
Publisher:              iDEFENSE
Operating System:       Windows
Impact:                 Execute Arbitrary Code/Commands
Access Required:        Remote
CVE Names:              CAN-2004-0377

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

Perl win32_stat Function Buffer Overflow Vulnerability

iDEFENSE Security Advisory 04.05.04
www.idefense.com/application/poi/display?id=93&type=vulnerabilities
April 5, 2004

I. BACKGROUND

Perl is a popular programming language due to its text manipulation
capabilities and rapid development cycle. It is open source, cross
platform and used for mission critical projects in the public and
private sector.

II. DESCRIPTION

Remote exploitation of a buffer overflow in the 'win32_stat' function of
ActiveState's ActivePerl and Larry Wall's Perl could allow for the
execution of arbitrary commands.

If the filename passed to the function ends with a backslash character,
it is copied into a fixed length buffer. There is no check made on the
length of the string before the copy, allowing an excessively long
string to overwrite control information, allowing execution of arbitrary
code.

The problem specifically exists within the win32 wrapper to the stat()
routine and hence the Unix builds of Perl are not affected.

III. ANALYSIS

The 'win32_stat' function is a wrapper around the 'stat' function and
the file test operators ('-r', '-w', '-e', '-d' etc) on Win32 based
platforms.

If a web site contains a Perl script that uses any of these functions
with user supplied pathnames, it may be possible to remotely execute
commands.

IV. DETECTION

All versions of Perl for Win32 operating systems up to and including
5.8.3 are affected.

V. VENDOR RESPONSE

The fix will be incorporated into core Perl 5.8.4. Patches are currently
available at the following locations:

Committed to the Perl 5.9.x development branch:

   http://public.activestate.com/cgi-bin/perlbrowse?patch=22466

Integrated into Perl 5.8.x maintenance branch as part of:

   http://public.activestate.com/cgi-bin/perlbrowse?patch=22552

VI. CVE INFORMATION

The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CAN-2004-0377 to this issue. This is a candidate for inclusion in
the CVE list (http://cve.mitre.org), which standardizes names for
security problems.

VII. DISCLOSURE TIMELINE

January 09, 2004     Vulnerability discovered by iDEFENSE
February 25, 2004    Initial vendor contact
February 26, 2004    iDEFENSE clients notified
February 26, 2004    Vendor response
April 05, 2004       Public disclosure

VIII. CREDIT

Greg MacManus (iDEFENSE Labs) is credited with this discovery.

Get paid for vulnerability research
http://www.idefense.com/poi/teams/vcp.jsp

IX. LEGAL NOTICES

Copyright (c) 2004 iDEFENSE, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDEFENSE. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email customerservice@idefense.com for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.

- --------------------------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 follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

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 computer system has been compromised or attacked in 
any way, we encourage you to let us know by completing the secure National IT 
Incident Reporting Form at:

        http://www.auscert.org.au/render.html?it=3192

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-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQCVAwUBQHICSyh9+71yA2DNAQI6hQP/bYKp3D09iVZKWXnALYPBvc31IO1WomZQ
xX0Z640EZo0JHf78E+We8xJOFesRkEody6WvsKKstxOzokywroS2FHJoaSOM0u+G
flhBPf7ADHhtYkR1zAnLy/oDGd1PzMqkE+QAV7RxX222g78bS//Oi+j9SZrbTLpO
RUsIHw/WB74=
=7yYL
-----END PGP SIGNATURE-----