Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:27327
HistoryNov 21, 2011 - 12:00 a.m.

Wordpress Zingiri Web Shop Plugin <= 2.2.3 Remote Code Execution Vulnerability

2011-11-2100:00:00
vulners.com
113

Wordpress Zingiri Web Shop Plugin <= 2.2.3 Remote Code Execution Vulnerability

authorโ€ฆ: Egidio Romano aka EgiX
mailโ€ฆ: n0b0d13s[at]gmail[dot]com
software linkโ€ฆ: http://wordpress.org/extend/plugins/zingiri-web-shop/
affected versionsโ€ฆ: from 0.9.12 to 2.2.3

[-] vulnerable code in /fws/addons/tinymce/jscripts/tiny_mce/plugins/ajaxfilemanager/ajax_save_name.php

  1.        @ob_start&#40;&#41;;
    
  2.        include_once&#40;CLASS_SESSION_ACTION&#41;;
    
  3.        $sessionAction = new SessionAction&#40;&#41;;        
    
  4.        $selectedDocuments = $sessionAction-&gt;get&#40;&#41;;
    
  5.        if&#40;removeTrailingSlash&#40;$sessionAction-&gt;getFolder&#40;&#41;&#41; == getParentPath&#40;$_POST[&#39;id&#39;]&#41; &amp;&amp; sizeof&#40;$selectedDocuments&#41;&#41;
    
  6.        {
    
  7.            if&#40;&#40;$key = array_search&#40;basename&#40;$_POST[&#39;id&#39;]&#41;, $selectedDocuments&#41;&#41; !== false&#41;
    
  8.            {
    
  9.                $selectedDocuments[$key] = $_POST[&#39;value&#39;];
    
  10.                $sessionAction-&gt;set&#40;$selectedDocuments&#41;;
    
  11.            }
    
  12.            echo basename&#40;$_POST[&#39;id&#39;]&#41; . &quot;&#92;n&quot;;
    
  13.            displayArray&#40;$selectedDocuments&#41;;
    
  14.        }elseif&#40;removeTrailingSlash&#40;$sessionAction-&gt;getFolder&#40;&#41;&#41; == removeTrailingSlash&#40;$_POST[&#39;id&#39;]&#41;&#41;
    
  15.        {
    
  16.            $sessionAction-&gt;setFolder&#40;$_POST[&#39;id&#39;]&#41;;
    
  17.        }
    
  18.        writeInfo&#40;ob_get_clean&#40;&#41;&#41;;
    

An attacker could be able to manipulate the $selectedDocuments array that will be displayed at line 50,
then at line 56 is called the 'writeInfo' function using the current buffer contents as argument.
Like my recently discovered vulnerability (http://www.exploit-db.com/exploits/18075/&#41;, this function
writes into a file called 'data.php' so an attacker could be able to execute arbitrary PHP code.

[-] Note:

The same vulnerability affects also the Joomla component (http://extensions.joomla.org/extensions/e-commerce/shopping-cart/13580&#41;
but isn't exploitable due to a misconfiguration in 'CONFIG_SYS_ROOT_PATH' constant definition.

[-] Disclosure timeline:

[23/11/2011] - Vulnerability discovered
[25/10/2011] - Issue reported to http://forums.zingiri.com/
[12/11/2011] - Version 2.2.4 released
[13/11/2011] - Public disclosure

[-] Proof of concept:

http://www.exploit-db.com/exploits/18111