Rapid7 Vulnerability & Exploit Database

Shopware createInstanceFromNamedArguments PHP Object Instantiation RCE

Back to Search

Shopware createInstanceFromNamedArguments PHP Object Instantiation RCE

Disclosed
05/09/2019
Created
05/18/2019

Description

This module exploits a php object instantiation vulnerability that can lead to RCE in Shopware. An authenticated backend user could exploit the vulnerability. The vulnerability exists in the createInstanceFromNamedArguments function, where the code insufficiently performs whitelist check which can be bypassed to trigger an object injection. An attacker can leverage this to deserialize an arbitrary payload and write a webshell to the target system, resulting in remote code execution. Tested on Shopware git branches 5.6, 5.5, 5.4, 5.3.

Author(s)

  • Karim Ouerghemmi
  • mr_me <steven@srcincite.io>

Platform

PHP

Architectures

php

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/multi/http/shopware_createinstancefromnamedarguments_rce
msf exploit(shopware_createinstancefromnamedarguments_rce) > show targets
    ...targets...
msf exploit(shopware_createinstancefromnamedarguments_rce) > set TARGET < target-id >
msf exploit(shopware_createinstancefromnamedarguments_rce) > show options
    ...show and set options...
msf exploit(shopware_createinstancefromnamedarguments_rce) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;