Bug 983689 (CVE-2013-4113)

Summary: CVE-2013-4113 php: xml_parse_into_struct buffer overflow when parsing deeply nested XML
Product: [Other] Security Response Reporter: Jan Lieskovsky <jlieskov>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: unspecifiedCC: fedora, jorton, rpm, webstack-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: php 5.3.27, php 5.4.18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-16 06:14:38 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: 983697, 983698, 983866, 983867, 983868, 983869, 983870, 983871, 983873, 983874, 983875, 983876, 983877, 983879, 983880, 983883, 984467    
Bug Blocks: 983702    

Description Jan Lieskovsky 2013-07-11 17:49:02 UTC
An array index error, leading to invalid free flaw was found in the way XML extension of PHP, a scripting language for creating dynamic web sites, used to convert certain XML files into PHP language internal structures. Remote attacker could provide a specially-crafted XML file, that when opened in an PHP application would lead to that application crash or, potentially, arbitrary code execution with the privileges of the user running the application.

References:
http://php.net/archive/2013.php#id2013-07-11-1
http://www.php.net/ChangeLog-5.php#5.3.27

Upstream bug report:
https://bugs.php.net/bug.php?id=65236

Relevant patch:
https://bugs.php.net/patch-display.php?bug_id=65236&patch=bug65236.diff&revision=latest
http://git.php.net/?p=php-src.git;a=commitdiff;h=7d163e8a0880ae8af2dd869071393e5dc07ef271

Comment 1 Jan Lieskovsky 2013-07-11 17:51:30 UTC
Testing script from upstream bug:

<?php
xml_parse_into_struct(xml_parser_create_ns(), str_repeat("<blah>", 1000), $a);


http://git.php.net/?p=php-src.git;a=commitdiff;h=710eee5555bc5c95692bd3c84f5d2b5d687349b6

Comment 2 Jan Lieskovsky 2013-07-11 17:59:47 UTC
This issue affects the versions of the php and php53 packages, as shipped with Red Hat Enterprise Linux 5.

--

This issue affects the version of the php package, as shipped with Red Hat Enterprise Linux 6.

--

This issue affects the versions of the php package, as shipped with Fedora release of 17, 18, and 19. Please schedule an update.

Comment 5 Jan Lieskovsky 2013-07-11 18:01:27 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 983698]

Comment 6 Jan Lieskovsky 2013-07-11 18:14:04 UTC
The CVE identifier of CVE-2013-4113 has been assigned to this issue:
  http://www.openwall.com/lists/oss-security/2013/07/11/6

Comment 13 errata-xmlrpc 2013-07-12 20:19:14 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2013:1050 https://rhn.redhat.com/errata/RHSA-2013-1050.html

Comment 14 errata-xmlrpc 2013-07-12 20:19:34 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6
  Red Hat Enterprise Linux 5

Via RHSA-2013:1049 https://rhn.redhat.com/errata/RHSA-2013-1049.html

Comment 16 errata-xmlrpc 2013-07-15 20:28:52 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4 Extended Lifecycle Support
  Red Hat Enterprise Linux 3 Extended Lifecycle Support

Via RHSA-2013:1063 https://rhn.redhat.com/errata/RHSA-2013-1063.html

Comment 17 errata-xmlrpc 2013-07-15 20:30:12 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5.6 EUS - Server Only

Via RHSA-2013:1062 https://rhn.redhat.com/errata/RHSA-2013-1062.html

Comment 18 errata-xmlrpc 2013-07-15 20:40:15 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5.3 Long Life
  Red Hat Enterprise Linux 5.6 EUS - Server Only
  Red Hat Enterprise Linux 6.2 EUS - Server Only
  Red Hat Enterprise Linux 6.3 EUS - Server Only

Via RHSA-2013:1061 https://rhn.redhat.com/errata/RHSA-2013-1061.html

Comment 19 Vincent Danen 2013-08-16 15:36:48 UTC
This has also been corrected in upstream 5.4.18:

http://www.php.net/ChangeLog-5.php#5.4.18

Comment 20 Vincent Danen 2014-11-24 16:41:51 UTC
Statement:

This issue does not affect the version of php54 as shipped with Red Hat Software Collections 1.