Skip to content

Commit

Permalink
* themes: prevent reflected XSS attack when requesting theme_info
Browse files Browse the repository at this point in the history
  • Loading branch information
NavigateCMS committed Nov 28, 2021
1 parent fabb471 commit dd2cef6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/packages/themes/themes.php
Expand Up @@ -15,7 +15,21 @@ function run()
switch($_REQUEST['act'])
{
case 'theme_info':
echo '<iframe src="'.NAVIGATE_URL.'/themes/'.$_REQUEST['theme'].'/'.$_REQUEST['theme'].'.info.html'.'" scrolling="auto" frameborder="0" width="100%" height="100%"></iframe>';
$themes_available = $theme->list_available();
$found = false;
foreach($themes_available as $ta)
{
if($ta['code'] == $_REQUEST['theme'])
{
$found = true;
break;
}
}

if($found)
{
echo '<iframe src="'.NAVIGATE_URL.'/themes/'.$_REQUEST['theme'].'/'.$_REQUEST['theme'].'.info.html'.'" scrolling="auto" frameborder="0" width="100%" height="100%"></iframe>';
}
core_terminate();
break;

Expand Down

0 comments on commit dd2cef6

Please sign in to comment.