Bug 548516 (CVE-2009-4142)

Summary: CVE-2009-4142 php: htmlspecialchars() insufficient checking of input for multi-byte encodings
Product: [Other] Security Response Reporter: Vincent Danen <vdanen>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: jorton, kreilly, mjc, qe-baseos-apps
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2009-4142
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-12 05:03:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 541594, 541595, 541596, 541597, 541598, 552268    
Bug Blocks:    
Attachments:
Description Flags
Upstream patch in 5.2 branch none

Description Vincent Danen 2009-12-17 17:12:09 UTC
PHP 5.2.12 was released with the following reference:

Fixed bug #49785 (insufficient input string validation of htmlspecialchars()). (CVE-2009-4142, Moriyoshi, hello at iwamot dot com)

A little more detail is available in upstream's bug report: http://bugs.php.net/bug.php?id=49785

Comment 1 Tomas Hoger 2009-12-18 14:13:53 UTC
As reported in the upstream bug, incorrect handling of invalid multi-byte sequences in htmlspecialchars() can allow XSS attacks caused by insufficient escaping of the inputs when certain encodings are used.

This flaw affects PHP versions in all currently supported Red Hat Enterprise Linux versions (3, 4, 5).

Fixed is committed in upstream 5.3 SVN branch, but is not yet included in the latest released 5.3 version (5.3.1).

Comment 2 Tomas Hoger 2009-12-18 14:18:52 UTC
Related upstream SVN commits: 289411, 289554, 289565, 289567, 289605, 291821

File with tests:
http://svn.php.net/viewvc/php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt

Comment 3 Tomas Hoger 2009-12-18 14:37:21 UTC
Created attachment 379223 [details]
Upstream patch in 5.2 branch

svn diff -r 272374:291821 http://svn.php.net/repository/php/php-src/branches/PHP_5_2/ext/standard/html.c

Comment 11 errata-xmlrpc 2010-01-13 18:10:16 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5
  Red Hat Enterprise Linux 4
  Red Hat Enterprise Linux 3

Via RHSA-2010:0040 https://rhn.redhat.com/errata/RHSA-2010-0040.html

Comment 12 Fedora Update System 2010-02-01 01:09:22 UTC
php-5.2.12-1.fc11, maniadrive-1.2-17.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.