0dd - The Zero (0) Day Division

The Zero (0) Day Division is a group of security professionals working towards a common goal; securing open-source projects.

OpenPSA PHP Objection Injection

The Issue

PHP Object Deserialization Injection attacks utilise the unserialize function within PHP. The deserialisation of the PHP object can trigger certain methods within the object, allowing the attacker to perform unauthorised actions like execution of code, disclosure of information, etc.

The OpenPSA project overly trusted user input when processing the data obtained from a form.

Where the Issue Occurred

Displayed below is the code within the OpenPSA project, in the openpsa/lib/midcom/services/auth/frontend/form.php file, where the user input is passed into the unserialize function:

if ($request->request->has('restore_form_data')) { 
    foreach ($request->request->get('restored_form_data', []) as $key => $string) { 
        $value = @unserialize(base64_decode($string)); 
        $request->request->set($key, $value); 
    } 
    $request->overrideGlobals(); 
} 

Disclosure Timeline

  • Issue Reported: 29th May 2018
  • Issue Resolved: 30th May 2018
  • Blog Post Published: 31st May 2018
  • Applied for CVE: 24th June 2018