Bug 1412245 (CVE-2016-7478)

Summary: CVE-2016-7478 php: Unserialize Exception object can lead to infinite loop
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abhgupta, hhorak, jorton, kseifried, rcollet, sardella, tiwillia
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-11 15:37:22 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:

Description Adam Mariš 2017-01-11 15:35:34 UTC
It was found that specially crafted input to unserialize, an exception object which refers to itself as the previous exception, may cause exception::__toString never to terminate, causing infinite loop.

Upstream bug:

https://bugs.php.net/bug.php?id=73093

External Reference:

https://blog.checkpoint.com/wp-content/uploads/2016/12/PHP_Technical_Report.pdf

Comment 1 Adam Mariš 2017-01-11 15:37:22 UTC
This issue happens when untrusted input is unserialized. Doing so is documented as being unsafe:

  http://php.net/manual/en/function.unserialize.php

  Do not pass untrusted user input to unserialize(). Unserialization can
  result in code being loaded and executed due to object instantiation and
  autoloading, and a malicious user may be able to exploit this. Use a safe,
  standard data interchange format such as JSON (via json_decode() and
  json_encode()) if you need to pass serialized data to the user.