__________________________________________________________ The U.S. Department of Energy Computer Incident Advisory Capability ___ __ __ _ ___ / | /_\ / \___ __|__ / \ \___ __________________________________________________________ INFORMATION BULLETIN PHP memory_limit and strip_tags Vulnerabilities [Red Hat RHSA-2004: 395-10 & RHSA-2004:392-13] July 19, 2004 21:00 GMT Number O-184 [REVISED 21 Jul 2004] [REVISED 05 Aug 2004] [REVISED 06 Aug 2004] [REVISED 07 Feb 2005] ______________________________________________________________________________ PROBLEM: 1) There's a flaw with the memory_limit configuration setting when enabled in versions of PHP 4 before v.4.3.8. 2) There's a flaw in the strip-tags function in versions of PHP 4 before v.4.3.8. PLATFORM: Red Hat Enterprise Linux AS, ES, and WS v2.1 Red Hat Enterprise Linux AS, ES, and WS v3 Debian GNU/Linux 3.0 (woody) HP-UX B.11.00, B.11.11, B.11.22, B.11.23 running the hpuxwsAPACHE HP-UX Web Server. ** NOTE: ** the vulnerabilities may affect other vendor platforms as well. CIAC will update this bulletin as vendor information is released. DAMAGE: 1) a remote attacker could execute arbitrary code 2) a remote attacker could do Cross-Site-Scripting attacks. SOLUTION: Apply appropriate vendor patches. ______________________________________________________________________________ VULNERABILITY The risk is MEDIUM. There is no evidence at this time that a ASSESSMENT: remote attacker could gain root access with these exploits. However, the attacker could execute arbitrary code if successful in allocating more memory than originally configured. Or the attacker could perform Cross-site-scripting attacks due to the malicious use of null characters inserted in HTML tags which the strip_tags function can't detect. ______________________________________________________________________________ LINKS: CIAC BULLETIN: http://www.ciac.org/ciac/bulletins/o-184.shtml ORIGINAL BULLETIN: https://rhn.redhat.com/errata/rhel3as-errata.html ADDITIONAL LINKS: Red Hat: https://rhn.redhat.com/errata/RHSA-2004-395.html Debian: http://www.debian.org/security/2004/dsa-531 SGI Security Advisories 20040702-01-U for Samba & 20040703-01-U for PHP http://www.sgi.com/support/security/advisories.html Visit HEWLETT PACKARD Subscription Service for: HPSBUX01064 / SSRT4777 rev. 0 Debian Security Advisory DSA-669-1 http://www.debian.org/security/2005/dsa-669 CVE/CAN: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name= CAN-2004-0594 CAN-2004-0595 ______________________________________________________________________________ REVISION HISTORY: 07/21/04 - added link to Debian Security Advisory DSA-531. 08/05/04 - added a link to SGI Security Advisories 20040702-01-U for Samba and 20040703-01-U for PHP. 08/06/04 - added link information because Hewlett Packard has released patches for their HP-UX Web Server software on their advisory HPSBUX01064 / SSRT4777 rev. 0. 02/07/05 - added a link to Debian Security Advisory DSA-669-1. [***** Start Red Hat RHSA-2004: 395-10 *****] Updated php packages fix security issues Advisory: RHSA-2004:395-10 Last updated on: 2004-07-19 Affected Products: Red Hat Enterprise Linux AS (v. 2.1) Red Hat Enterprise Linux ES (v. 2.1) Red Hat Enterprise Linux WS (v. 2.1) Red Hat Linux Advanced Workstation 2.1 for the Itanium Processor CVEs (cve.mitre.org): CAN-2004-0594 CAN-2004-0595 Security Advisory Details: Updated php packages that fix various security issues are now available. PHP is an HTML-embedded scripting language commonly used with the Apache HTTP server. Stefan Esser discovered a flaw when memory_limit configuration setting is enabled in versions of PHP 4 before 4.3.8. If a remote attacker could force the PHP interpreter to allocate more memory than the memory_limit setting before script execution begins, then the attacker may be able to supply the contents of a PHP hash table remotely. This hash table could then be used to execute arbitrary code as the 'apache' user. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CAN-2004-0594 to this issue. This issue may be exploitable if using the default PHP configuration with the "register_globals" setting of "On". The Apache memory exhaustion bug, fixed in a previous update to Red Hat Enterprise Linux 3, may also allow this PHP issue to be exploited; this Apache bug does not affect Red Hat Enterprise Linux 2.1. Stefan Esser discovered a flaw in the strip_tags function in versions of PHP before 4.3.8. The strip_tags function is commonly used by PHP scripts to prevent Cross-Site-Scripting attacks by removing HTML tags from user-supplied form data. By embedding NUL bytes into form data, HTML tags can in some cases be passed intact through the strip_tags function, which may allow a Cross-Site-Scripting attack. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CAN-2004-0595 to this issue. All users of PHP are advised to upgrade to these updated packages, which contain backported patches that address these issues. Updated packages: Red Hat Enterprise Linux AS (v. 2.1) ----------------------------------------------------------------------------- SRPMS: php-4.1.2-2.1.8.src.rpm a3710916a788e214dd27442e2f369008 i386: php-4.1.2-2.1.8.i386.rpm 6dccaf45719dc7c8ecb29df7d9a28e6c php-devel-4.1.2-2.1.8.i386.rpm d94f28bcd430fb1dfd9235af6c4af4df php-imap-4.1.2-2.1.8.i386.rpm 2a988813d6733e42bdd66b5691172953 php-ldap-4.1.2-2.1.8.i386.rpm 0f11a0d7ce0b62b9db26bd84473dfbe0 php-manual-4.1.2-2.1.8.i386.rpm 3e5975c1d66d9d6b4def98ececa876ce php-mysql-4.1.2-2.1.8.i386.rpm 1dc6c9a792bd4108f1ca5b01b8efdcc3 php-odbc-4.1.2-2.1.8.i386.rpm c1f1e537f8c81ce42018bd788091f60c php-pgsql-4.1.2-2.1.8.i386.rpm 79d40cdd20a74f7c6b23823bee29b150 ia64: php-4.1.2-2.1.8.ia64.rpm a11020ac53d63ce4e2df2708da21591d php-devel-4.1.2-2.1.8.ia64.rpm a1e8e665332c3f3456d1eec24700aaa3 php-imap-4.1.2-2.1.8.ia64.rpm 96dbf23b1a8b6234ad61502fb954a318 php-ldap-4.1.2-2.1.8.ia64.rpm 70b672ea65599968de47e36ecae14cf9 php-manual-4.1.2-2.1.8.ia64.rpm aa60f963a99e6fd3ade2127775aca5fe php-mysql-4.1.2-2.1.8.ia64.rpm 5ff4cd8846d5b5ef599378cdc8471de4 php-odbc-4.1.2-2.1.8.ia64.rpm 3bba7c50cd769721e32d3625eb5ca2d6 php-pgsql-4.1.2-2.1.8.ia64.rpm 1bf23359ab411249b1e7c386851cb066 Red Hat Enterprise Linux ES (v. 2.1) ----------------------------------------------------------------------------- SRPMS: php-4.1.2-2.1.8.src.rpm a3710916a788e214dd27442e2f369008 i386: php-4.1.2-2.1.8.i386.rpm 6dccaf45719dc7c8ecb29df7d9a28e6c php-devel-4.1.2-2.1.8.i386.rpm d94f28bcd430fb1dfd9235af6c4af4df php-imap-4.1.2-2.1.8.i386.rpm 2a988813d6733e42bdd66b5691172953 php-ldap-4.1.2-2.1.8.i386.rpm 0f11a0d7ce0b62b9db26bd84473dfbe0 php-manual-4.1.2-2.1.8.i386.rpm 3e5975c1d66d9d6b4def98ececa876ce php-mysql-4.1.2-2.1.8.i386.rpm 1dc6c9a792bd4108f1ca5b01b8efdcc3 php-odbc-4.1.2-2.1.8.i386.rpm c1f1e537f8c81ce42018bd788091f60c php-pgsql-4.1.2-2.1.8.i386.rpm 79d40cdd20a74f7c6b23823bee29b150 Red Hat Enterprise Linux WS (v. 2.1) ----------------------------------------------------------------------------- SRPMS: php-4.1.2-2.1.8.src.rpm a3710916a788e214dd27442e2f369008 i386: php-4.1.2-2.1.8.i386.rpm 6dccaf45719dc7c8ecb29df7d9a28e6c php-devel-4.1.2-2.1.8.i386.rpm d94f28bcd430fb1dfd9235af6c4af4df php-imap-4.1.2-2.1.8.i386.rpm 2a988813d6733e42bdd66b5691172953 php-ldap-4.1.2-2.1.8.i386.rpm 0f11a0d7ce0b62b9db26bd84473dfbe0 php-manual-4.1.2-2.1.8.i386.rpm 3e5975c1d66d9d6b4def98ececa876ce php-mysql-4.1.2-2.1.8.i386.rpm 1dc6c9a792bd4108f1ca5b01b8efdcc3 php-odbc-4.1.2-2.1.8.i386.rpm c1f1e537f8c81ce42018bd788091f60c php-pgsql-4.1.2-2.1.8.i386.rpm 79d40cdd20a74f7c6b23823bee29b150 Red Hat Linux Advanced Workstation 2.1 for the Itanium Processor ----------------------------------------------------------------------------- SRPMS: php-4.1.2-2.1.8.src.rpm a3710916a788e214dd27442e2f369008 ia64: php-4.1.2-2.1.8.ia64.rpm a11020ac53d63ce4e2df2708da21591d php-devel-4.1.2-2.1.8.ia64.rpm a1e8e665332c3f3456d1eec24700aaa3 php-imap-4.1.2-2.1.8.ia64.rpm 96dbf23b1a8b6234ad61502fb954a318 php-ldap-4.1.2-2.1.8.ia64.rpm 70b672ea65599968de47e36ecae14cf9 php-manual-4.1.2-2.1.8.ia64.rpm aa60f963a99e6fd3ade2127775aca5fe php-mysql-4.1.2-2.1.8.ia64.rpm 5ff4cd8846d5b5ef599378cdc8471de4 php-odbc-4.1.2-2.1.8.ia64.rpm 3bba7c50cd769721e32d3625eb5ca2d6 php-pgsql-4.1.2-2.1.8.ia64.rpm 1bf23359ab411249b1e7c386851cb066 (The unlinked packages above are only available from the Red Hat Network) Solution Before applying this update, make sure that all previously-released errata relevant to your system have been applied. Use Red Hat Network to download and update your packages. To launch the Red Hat Update Agent, use the following command: up2date For information on how to install packages manually, refer to the following Web page for the System Administration or Customization guide specific to your system: http://www.redhat.com/docs/manuals/enterprise/ Bugs fixed: (see bugzilla for more information) 127642 - CAN-2004-0594 PHP memory_limit issue References: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0594 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0595 ----------------------------------------------------------------------------- The listed packages are GPG signed by Red Hat, Inc. for security. Our key is available at: http://www.redhat.com/solutions/security/news/publickey/#key You can verify each package and see who signed it with the following command: rpm --checksig -v filename If you only wish to verify that each package has not been corrupted or tampered with, examine only the md5sum with the following command: md5sum filename The Red Hat security contact is security@redhat.com. More contact details at http://www.redhat.com/solutions/security/news/contact.html Copyright © 2002 Red Hat, Inc. All rights reserved. [***** End Red Hat RHSA-2004: 395-10 *****] _______________________________________________________________________________ CIAC wishes to acknowledge the contributions of Red Hat, Inc. for the information contained in this bulletin. _______________________________________________________________________________ CIAC, the Computer Incident Advisory Capability, is the computer security incident response team for the U.S. Department of Energy (DOE) and the emergency backup response team for the National Institutes of Health (NIH). CIAC is located at the Lawrence Livermore National Laboratory in Livermore, California. CIAC is also a founding member of FIRST, the Forum of Incident Response and Security Teams, a global organization established to foster cooperation and coordination among computer security teams worldwide. CIAC services are available to DOE, DOE contractors, and the NIH. CIAC can be contacted at: Voice: +1 925-422-8193 (7x24) FAX: +1 925-423-8002 STU-III: +1 925-423-2604 E-mail: ciac@ciac.org Previous CIAC notices, anti-virus software, and other information are available from the CIAC Computer Security Archive. World Wide Web: http://www.ciac.org/ Anonymous FTP: ftp.ciac.org PLEASE NOTE: Many users outside of the DOE, ESnet, and NIH computing communities receive CIAC bulletins. If you are not part of these communities, please contact your agency's response team to report incidents. Your agency's team will coordinate with CIAC. The Forum of Incident Response and Security Teams (FIRST) is a world-wide organization. A list of FIRST member organizations and their constituencies can be obtained via WWW at http://www.first.org/. This document was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the University of California nor any of their employees, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial products, process, or service by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation or favoring by the United States Government or the University of California. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or the University of California, and shall not be used for advertising or product endorsement purposes. LAST 10 CIAC BULLETINS ISSUED (Previous bulletins available from CIAC) O-174: Ethereal Multiple Problems in 0.10.4 O-175: 'shell:' Protocol Security Issue O-176: Adobe Acrobat and Adobe Reader Filename Handler Buffer Overflow O-177: Multiple Vulnerabilities in ISC DHCP 3 O-178: Vulnerability in Task Scheduler Could Allow Code Execution O-179: Microsoft Update for IIS 4.0 (841373) O-180: Microsoft Utility Manager Vulnerability O-181: Microsoft Vulnerability in POSIX Could Allow Code Execution O-182: Microsoft Vulnerability in HTML Help Could Allow Code Execution O-183: Microsoft Vulnerability in Windows Shell Could Allow Remote Code Execution