Skip to content

Commit

Permalink
Fixed issue #8398: XSS issue in label sets administration and path/SQ…
Browse files Browse the repository at this point in the history
…L revelation issue in usergroup administration

Dev Partial fix
  • Loading branch information
c-schmitz committed Nov 22, 2013
1 parent 5cb0e00 commit 5788c57
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions application/controllers/admin/usergroups.php
Expand Up @@ -174,13 +174,13 @@ public function add()

if (Yii::app()->session['USER_RIGHT_SUPERADMIN'] == 1) {
$db_group_name = $_POST['group_name'];
$db_group_description = $_POST['group_description'];

$db_group_name = flattenText($_POST['group_name'],false,true,'UTF-8',true);
if (isset($db_group_name) && strlen($db_group_name) > 0) {
if (strlen($db_group_name) > 21) {
list($aViewUrls, $aData) = $this->index(false, array("type" => "warning", "message" => $clang->gT("Failed to add group! Group name length more than 20 characters.")));
}
elseif (User_groups::model()->find("name='$db_group_name'")) {
elseif (User_groups::model()->find("name=:groupName", array(':groupName'=>$db_group_name))) {
list($aViewUrls, $aData) = $this->index(false, array("type" => "warning", "message" => $clang->gT("Failed to add group! Group already exists.")));
}
else
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/admin/label_helper.php
Expand Up @@ -98,7 +98,7 @@ function insertlabelset()
$clang = Yii::app()->lang;

$postlanguageids=sanitize_languagecodeS(Yii::app()->getRequest()->getPost('languageids'));
$postlabel_name=Yii::app()->getRequest()->getPost('label_name');
$postlabel_name=flattenText(Yii::app()->getRequest()->getPost('label_name'),false,true,'UTF-8',true);

This comment has been minimized.

Copy link
@Shnoulle

Shnoulle Nov 22, 2013

Collaborator

Hi,

Understand, but remove the habilty to use some HTML inside label.
Sorry ....

No need HTML in label name ... only used internal ...

So sorry :)

But we need to fix display value only.


$data = array(
'label_name' => $postlabel_name,
Expand Down
2 changes: 1 addition & 1 deletion application/views/admin/labels/labelsetsbar_view.php
Expand Up @@ -27,7 +27,7 @@
{ ?>
<option value='<?php echo $this->createUrl("admin/labels/sa/view/lid/".$lb[0]); ?>'
<?php if ($lb[0] == $lid) { ?> selected='selected' <?php } ?>
><?php echo $lb[1]; ?></option>
><?php echo htmlspecialchars($lb[1],ENT_QUOTES); ?></option>
<?php }
} ?>

Expand Down

0 comments on commit 5788c57

Please sign in to comment.