XSS vulnerability

post released sites here made with phpwcms

XSS vulnerability

Postby Oliver Georgi » Fri Jul 02, 2010 06:54

Yesterday I got report of an existing XSS vulnerability.
http://www.htbridge.ch/advisory/xss_vul ... pwcms.html

It seems to have an effect only when you are logged in to the backend. If you do not use the calendar module of phpwcms, just delete folder
include/inc_module/mod_calendar

The fix for this is change starting around line 42 to:
For all releases this is enough:
Code: Select all
// Change:
$_SESSION['calendardate'] = clean_slweg($_GET['calendardate']);
// To:
$_SESSION['calendardate'] = substr(clean_slweg($_GET['calendardate']), 0, 7);


For newer releases use
Code: Select all
// define some defaults
if(isset($_GET['calendardate'])) {

   $_SESSION['calendardate'] = substr(clean_slweg($_GET['calendardate']), 0, 7);

}
if(!empty($_SESSION['calendardate'])) {

   @list($plugin['current_month'], $plugin['current_year']) = explode('-', $_SESSION['calendardate']);
   
   $plugin['current_month']   = intval($plugin['current_month']);
   $plugin['current_year']      = intval($plugin['current_year']);
   
   if(empty($plugin['current_year'])) {
      $plugin['current_year']      = gmdate('Y');
   }
   if(empty($plugin['current_month'])) {
      $plugin['current_month']      = gmdate('n');
   }

} else {

   $plugin['current_year']      = gmdate('Y');
   $plugin['current_month']   = gmdate('n');

}


Or use the attached file
Attachments
backend.listing.php.zip
replace the file include/inc_module/mod_calendar/backend.listing.php with unarchived version — make backup of old file and test it
(4.39 KiB) Downloaded 30 times
Last edited by Oliver Georgi on Sun Jul 04, 2010 07:35, edited 1 time in total.
Reason: Show all users in forum
Oliver Georgi | phpwcms Developer
Hegerplatz 7, 06846 Dessau, Germany
phpwcms | webverbund.de | LinkedIn | XING | Facebook | Twitter | Get DropBox
User avatar
Oliver Georgi
Site Admin
 
Posts: 7049
Joined: Fri Oct 03, 2003 22:22
Location: Dessau

Return to sites you are proud of (made with phpwcms only)

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests