exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

tikiwiki-traverse.txt

tikiwiki-traverse.txt
Posted Dec 24, 2007
Authored by Jesus Olmos Gonzalez

The Tikiwiki CMS has a vulnerability that allows an attacker to get the first 1000 bytes from an arbitrary file through the tiki-listmovies.php script.

tags | exploit, arbitrary, php, file inclusion
SHA-256 | c5dec4df826c950a9c132ae47977fa8e7beb6ae4e962420270fa9eb27e09c5b1

tikiwiki-traverse.txt

Change Mirror Download
=============================================
INTERNET SECURITY AUDITORS ALERT 2007-006
- Original release date: December 18th, 2007
- Last revised: December 24th, 2007
- Discovered by: Jesus Olmos Gonzalez
- Severity: 5/5
=============================================

I. VULNERABILITY
-------------------------
Tikiwiki CMS is vulnerable to path traversal attack

II. BACKGROUND
-------------------------
Tikiwiki (Tiki) is a Free Software (LGPL) Content Management System
solution that unifies many features like wikis, forums, blogs,
articles, galleries, mapserver, link directory.

This software is massively used in the World Wide Web, and has been
audited by the security community for years.

III. DESCRIPTION
-------------------------
It is possible to get the first 1000 bytes from an arbitrary file
trough the tiki-listmovies.php script.

This script sets the movie parameter value into $movie. The last 4
bytes are erased and an .xml extension is appended. Then, the file is
opened for reading with the call fopen($confFile,'r') and the first
1000 bytes are read from the file. Then the 1000 bytes are parsed and
used as the values for MovieWidth and MovieHeight HTML tags. Finally
the resulting HTML file is returned to the user by the webserver.

The vulnerable snippet of code is:

if(isset($_GET["movie"])) {
$movie = $_GET["movie"];
...

if ($movie) {
// Initialize movie size
$confFile = 'tikimovies/'.substr($movie,0,-4).".xml";

//trc('confFile', $confFile);
$fh = @fopen($confFile,'r');
$config = @fread($fh, 1000);
@fclose($fh);
if (isset($config) && $config <>'') {
$width =
preg_replace("/^.*?<MovieWidth>(.*?)<\/MovieWidth>.*$/ms", "$1", $config);
$height =
preg_replace("/^.*?<MovieHeight>(.*?)<\/MovieHeight>.*$/ms", "$1",
$config);
$smarty->assign('movieWidth',$width);
$smarty->assign('movieHeight',$height);
}
}

The avoidable controls that permit exploiting the flaw are:

* First, 'tikimovies/' is prepended to the filename, so we could
reference a relative filesystem object like
'../../../../../../file_name'. This could also allow the attacker to
get the database password at the config file, or obtain any other
files outside the web directory, let's say '/etc/passwd'.
* Second, the four ending 4 bytes are removed from the $movie
variables. So adding 4 trash ending bytes to our evil string this
control also can be bypassed
* At the end, an .xml extension is added at the end of the variable.
We finally avoid this adding the null byte (%00) in our value.

The resulting evil string to access the file looks like this:

../../../../../../etc/passwd%001234


IV. PROOF OF CONCEPT
-------------------------
http://www.victym.com/tiki-listmovies.php?movie=../../../../../../etc/passwd%001234

V. BUSINESS IMPACT
-------------------------
The confidentiality is directly broken, and getting config files the
attacker probably access to the system to break integrity.

VI. SYSTEMS AFFECTED
-------------------------
All versions of tikiwiki are affected up to 1.9.9.

VII. SOLUTION
-------------------------
Update to version 1.9.9 or patch.

VIII. REFERENCES
-------------------------
http://info.tikiwiki.org

IX. CREDITS
-------------------------
This vulnerability has been discovered and reported
by Jesus Olmos Gonzalez (jolmos (at) isecauditors (dot) com).

X. REVISION HISTORY
-------------------------
December 18, 2007: Initial release.
December 24, 2007: Published. Happy 2008!

XI. DISCLOSURE TIMELINE
-------------------------
December 18, 2007: Vulnerability acquired by
Internet Security Auditors (www.isecauditors.com)
December 18, 2007: Development team is contacted. Patch coming.
December 22, 2007: New version of Tikiwiki CMS published.

XII. LEGAL NOTICES
-------------------------
The information contained within this advisory is supplied "as-is"
with no warranties or guarantees of fitness of use or otherwise.
Internet Security Auditors, S.L. accepts no responsibility for any
damage caused by the use or misuse of this information.
Login or Register to add favorites

File Archive:

May 2023

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    15 Files
  • 2
    May 2nd
    16 Files
  • 3
    May 3rd
    38 Files
  • 4
    May 4th
    15 Files
  • 5
    May 5th
    35 Files
  • 6
    May 6th
    0 Files
  • 7
    May 7th
    0 Files
  • 8
    May 8th
    8 Files
  • 9
    May 9th
    65 Files
  • 10
    May 10th
    19 Files
  • 11
    May 11th
    27 Files
  • 12
    May 12th
    8 Files
  • 13
    May 13th
    0 Files
  • 14
    May 14th
    1 Files
  • 15
    May 15th
    19 Files
  • 16
    May 16th
    66 Files
  • 17
    May 17th
    28 Files
  • 18
    May 18th
    32 Files
  • 19
    May 19th
    13 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    23 Files
  • 23
    May 23rd
    15 Files
  • 24
    May 24th
    49 Files
  • 25
    May 25th
    20 Files
  • 26
    May 26th
    13 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close