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

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

                       ESB-2007.0770 -- [UNIX/Linux]
     Asterisk - Buffer overflows in voicemail when using IMAP storage
                              18 October 2007

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

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

Product:              Asterisk Open Source 1.4.12 and prior
Publisher:            Digium
Operating System:     UNIX variants (UNIX, Linux, OSX)
Impact:               Execute Arbitrary Code/Commands
Access:               Remote/Unauthenticated
CVE Names:            CVE-2007-5358

Original Bulletin:  
  http://downloads.digium.com/pub/security/AST-2007-022.html

Revision History:     October 18 2007: Added CVE
                      October 11 2007: Initial Release

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

                Asterisk Project Security Advisory - AST-2007-022

    +------------------------------------------------------------------------+
    |      Product       | Asterisk                                          |
    |--------------------+---------------------------------------------------|
    |      Summary       | Buffer overflows in voicemail when using IMAP     |
    |                    | storage                                           |
    |--------------------+---------------------------------------------------|
    | Nature of Advisory | Remotely and locally exploitable buffer overflows |
    |--------------------+---------------------------------------------------|
    |   Susceptibility   | Remote Unauthenticated Sessions                   |
    |--------------------+---------------------------------------------------|
    |      Severity      | Minor                                             |
    |--------------------+---------------------------------------------------|
    |   Exploits Known   | No                                                |
    |--------------------+---------------------------------------------------|
    |    Reported On     | October 9, 2007                                   |
    |--------------------+---------------------------------------------------|
    |    Reported By     | Russell Bryant <russell@digium.com>               |
    |                    |                                                   |
    |                    | Mark Michelson <mmichelson@digium.com>            |
    |--------------------+---------------------------------------------------|
    |     Posted On      | October 9, 2007                                   |
    |--------------------+---------------------------------------------------|
    |  Last Updated On   | October 10, 2007                                  |
    |--------------------+---------------------------------------------------|
    |  Advisory Contact  | Mark Michelson <mmichelson@digium.com>            |
    |--------------------+---------------------------------------------------|
    |      CVE Name      |                                                   |
    +------------------------------------------------------------------------+

    +------------------------------------------------------------------------+
    | Description | The function "sprintf" was used heavily throughout the   |
    |             | IMAP-specific voicemail code. After auditing the code,   |
    |             | two vulnerabilities were discovered, both buffer         |
    |             | overflows.                                               |
    |             |                                                          |
    |             | The following buffer overflow required write access to   |
    |             | Asterisk's configuration files in order to be exploited. |
    |             |                                                          |
    |             | 1) If a combination of the astspooldir (set in           |
    |             | asterisk.conf), the voicemail context, and voicemail     |
    |             | mailbox, were very long, then there was a buffer         |
    |             | overflow when playing a message or forwarding a message  |
    |             | (in the case of forwarding, the context and mailbox in   |
    |             | question are the context and mailbox that the message    |
    |             | was being forwarded to).                                 |
    |             |                                                          |
    |             | The following buffer overflow could be exploited         |
    |             | remotely.                                                |
    |             |                                                          |
    |             | 2) If any one of, or any combination of the Content-type |
    |             | or Content-description headers for an e-mail that        |
    |             | Asterisk recognized as a voicemail message contained     |
    |             | more than a 1024 characters, then a buffer would         |
    |             | overflow while listening to a voicemail message via a    |
    |             | telephone. It is important to note that this did NOT     |
    |             | affect users who get their voicemail via an e-mail       |
    |             | client.                                                  |
    +------------------------------------------------------------------------+

    +------------------------------------------------------------------------+
    | Resolution | "sprintf" calls have been changed to "snprintf" wherever  |
    |            | space was not specifically allocated to the buffer prior  |
    |            | to the sprintf call. This includes places which are not   |
    |            | currently prone to buffer overflows.                      |
    +------------------------------------------------------------------------+

    +------------------------------------------------------------------------+
    |                           Affected Versions                            |
    |------------------------------------------------------------------------|
    |             Product              |   Release   |                       |
    |                                  |   Series    |                       |
    |----------------------------------+-------------+-----------------------|
    |       Asterisk Open Source       |    1.0.x    | Unaffected            |
    |----------------------------------+-------------+-----------------------|
    |       Asterisk Open Source       |    1.2.x    | Unaffected            |
    |----------------------------------+-------------+-----------------------|
    |       Asterisk Open Source       |    1.4.x    | All versions prior to |
    |                                  |             | 1.4.13                |
    |----------------------------------+-------------+-----------------------|
    |    Asterisk Business Edition     |    A.x.x    | Unaffected            |
    |----------------------------------+-------------+-----------------------|
    |    Asterisk Business Edition     |    B.x.x    | Unaffected            |
    |----------------------------------+-------------+-----------------------|
    |           AsteriskNOW            | pre-release | Unaffected            |
    |----------------------------------+-------------+-----------------------|
    | Asterisk Appliance Developer Kit |    0.x.x    | Unaffected            |
    |----------------------------------+-------------+-----------------------|
    |    s800i (Asterisk Appliance)    |    1.0.x    | Unaffected            |
    +------------------------------------------------------------------------+

    +------------------------------------------------------------------------+
    |                              Corrected In                              |
    |------------------------------------------------------------------------|
    |                 Product                  |           Release           |
    |------------------------------------------+-----------------------------|
    |           Asterisk Open Source           |           1.4.13            |
    |------------------------------------------+-----------------------------|
    |------------------------------------------+-----------------------------|
    +------------------------------------------------------------------------+

    +------------------------------------------------------------------------+
    |        Links        |                                                  |
    +------------------------------------------------------------------------+

    +------------------------------------------------------------------------+
    | Asterisk Project Security Advisories are posted at                     |
    | http://www.asterisk.org/security.                                      |
    |                                                                        |
    | This document may be superseded by later versions; if so, the latest   |
    | version will be posted at                                              |
    | http://downloads.digium.com/pub/security/AST-2007-022.pdf and          |
    | http://downloads.digium.com/pub/security/AST-2007-022.html.            |
    +------------------------------------------------------------------------+

    +------------------------------------------------------------------------+
    |                            Revision History                            |
    |------------------------------------------------------------------------|
    |        Date        |          Editor           |    Revisions Made     |
    |--------------------+---------------------------+-----------------------|
    | October 9, 2007    | mmichelson@digium.com     | Initial Release       |
    +------------------------------------------------------------------------+

                Asterisk Project Security Advisory - AST-2007-022
               Copyright (c) 2007 Digium, Inc. All Rights Reserved.
   Permission is hereby granted to distribute and publish this advisory in its
                            original, unaltered form.

- --------------------------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.

NOTE: Third Party Rights
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

===========================================================================
Australian Computer Emergency Response Team
The University of Queensland
Brisbane
Qld 4072

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

iQCVAwUBRxbZCCh9+71yA2DNAQKVMgP/SR899sLtVo5OK67tZ/g/GGTdHseP6Hqr
zHQ4pV5WQoSNM9eL2gadZWoJwQ7vYvKGLjdavWAGPvdVcCBhcq2dFiUi56eShR6j
J8UeUWpEly6hJI5r44Lgz8tGH9xJ7RmmRPXAnNZYtQlBAv85umr3PxM9Z4v4xph5
hlBUGjxDBLI=
=uXb2
-----END PGP SIGNATURE-----