Buffer overflow in PHP "wordwrap" function

From: David F. Skoll (dfs@roaringpenguin.com)
Date: 12/27/02

  • Next message: Daniel Ahlberg: "GLSA: cyrus-sasl"
    Date: Fri, 27 Dec 2002 16:43:44 -0500 (EST)
    From: "David F. Skoll" <dfs@roaringpenguin.com>
    To: bugtraq@securityfocus.com
    
    

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

    There is a buffer overflow in PHP's built-in "wordwrap" function
    for PHP versions greater than 4.1.2 and less than 4.3.0.

    Please see http://bugs.php.net/bug.php?id=20927 for details.

    If you use the wordwrap() function on user-supplied input, a
    specially-crafted input can overflow the allocated buffer and
    overwrite the heap. Exploit looks very difficult, but still
    theoretically possible.

    Status:

    Bug cause discovered: 10 Dec 2002
    PHP team notified: 10 Dec 2002
    Bug fixed in CVS: 12 Dec 2002
    PHP 4.3.0 released: 27 Dec 2002

    Kudos to the PHP team for their extremely rapid reaction.

    Recommendations:

    Don't upgrade from 4.1.2 if you are certain there are no security problems
    with your 4.1.2 setup and you may be vulnerable to the wordwrap() bug.

    Otherwise, upgrade to 4.3.0

    - --
    David F. Skoll

    Roaring Penguin Software Inc. | http://www.roaringpenguin.com
    GPG fingerprint: 58BB 6D86 6F6F 84D0 2C89 59D1 CD1C CAEE 1362 4131
    GPG public key: http://www.roaringpenguin.com/dskoll-key-2003.txt ID: 13624131
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.0.6 (GNU/Linux)
    Comment: For info see http://quantumlab.net/pine_privacy_guard/

    iD8DBQE+DMmUzRzK7hNiQTERAngfAKCAz0vUMBS4o+ZMLExpE6Q+ABcKdgCdHVpD
    24SOO2IcJ1VPotswMfOQa58=
    =DX/n
    -----END PGP SIGNATURE-----



    Relevant Pages

    • [Full-disclosure] [ GLSA 200605-08 ] PHP: Multiple vulnerabilities
      ... Title: PHP: Multiple vulnerabilities ... PHP is affected by multiple issues, including a buffer overflow in ... wordwrap() which may lead to execution of arbitrary code. ... security bypass or information leak. ...
      (Full-Disclosure)
    • [ GLSA 200605-08 ] PHP: Multiple vulnerabilities
      ... Title: PHP: Multiple vulnerabilities ... PHP is affected by multiple issues, including a buffer overflow in ... wordwrap() which may lead to execution of arbitrary code. ... security bypass or information leak. ...
      (Bugtraq)
    • RE: [PHP] Re: Breaking a line in two
      ... Warren Vail ... in HTML the space is irrelevant if you are breaking ... If you use wordwrap, you don't need nl2br. ... PHP General Mailing List ...
      (php.general)
    • Re: Why are PHP functions named so strangely?
      ... Historical reasons. ... Functions without the underscore.. ... like wordwrap come from the ... You'll find that while PHP includes the kitchen sink you ...
      (alt.php)
    • Re: php extensions compile error - another compile bug?
      ... Re: php extensions compile error - another compile bug?: ... Is not triviality is a matter of perspective? ... AFFECTS: users of PHP ... and shared extensions to allow more flexibility and add new features. ...
      (freebsd-questions)