Skip to content

Commit

Permalink
Fix several XSS in delete forms.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Oct 29, 2013
1 parent dbb0c9c commit 30bc1d0
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 12 deletions.
1 change: 1 addition & 0 deletions horde/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v5.1.5-git
----------

[jan] SECURITY: Fix XSS vulnerabilities in top and left menu.
[jan] Don't show admin alarm form if alarms are disabled.
[mms] Add horde-remove-user-data command-line script.
[mms] Add additional syntax checking for the configuration files in the test
Expand Down
4 changes: 2 additions & 2 deletions horde/js/topbar.js
Expand Up @@ -58,7 +58,7 @@ var HordeTopbar = {
}
item.insert(this._renderBranch(nodes, nodes[root_node].children));
}
elm.insert(nodes[root_node].label);
elm.insert(nodes[root_node].label.escapeHTML());
$('horde-navigation')
.insert(new Element('DIV', { className: 'horde-navipoint' })
.insert(new Element('DIV', { className: 'horde-point-left' + active }))
Expand Down Expand Up @@ -86,7 +86,7 @@ var HordeTopbar = {
} else {
elm = container;
}
elm.insert(nodes[child].label);
elm.insert(nodes[child].label.escapeHTML());
item = new Element('LI', attr).insert(container);
if (nodes[child].children) {
item.insert(this._renderBranch(nodes, nodes[child].children));
Expand Down
7 changes: 4 additions & 3 deletions horde/lib/View/Sidebar.php
Expand Up @@ -167,9 +167,10 @@ public function addRow(array $row, $container = '')

$boxrow = isset($row['type']) &&
($row['type'] == 'checkbox' || $row['type'] == 'radiobox');
$label = htmlspecialchars($row['label']);

if (isset($row['url'])) {
$ak = Horde::getAccessKey($row['label']);
$ak = Horde::getAccessKey($label);
$url = empty($row['url']) ? new Horde_Url() : $row['url'];
$attributes = $ak
? array('accesskey' => $ak)
Expand All @@ -192,11 +193,11 @@ public function addRow(array $row, $container = '')
}
}
$row['link'] = $url->link($attributes)
. Horde::highlightAccessKey($row['label'], $ak)
. Horde::highlightAccessKey($label, $ak)
. '</a>';
} else {
$row['link'] = '<span class="horde-resource-none">'
. $row['label'] . '</span>';
. $label . '</span>';
}

if ($boxrow) {
Expand Down
2 changes: 2 additions & 0 deletions horde/package.xml
Expand Up @@ -39,6 +39,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl">LGPL-2</license>
<notes>
* [jan] SECURITY: Fix XSS vulnerabilities in top and left menu.
* [jan] Don&apos;t show admin alarm form if alarms are disabled.
* [mms] Add horde-remove-user-data command-line script.
* [mms] Add additional syntax checking for the configuration files in the test script.
Expand Down Expand Up @@ -3777,6 +3778,7 @@
<date>2013-10-19</date>
<license uri="http://www.horde.org/licenses/lgpl">LGPL-2</license>
<notes>
* [jan] SECURITY: Fix XSS vulnerabilities in top and left menu.
* [jan] Don&apos;t show admin alarm form if alarms are disabled.
* [mms] Add horde-remove-user-data command-line script.
* [mms] Add additional syntax checking for the configuration files in the test script.
Expand Down
1 change: 1 addition & 0 deletions kronolith/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.1.4-git
----------

[jan] SECURITY: Fix XSS vulnerabilities when deleting calendars and resources.
[jan] Fix edge case that allowed to enter start time after end time (Bug
#12752).
[mjr] Expire fb cache when fb_cals preference changes (Bug #12714).
Expand Down
2 changes: 1 addition & 1 deletion kronolith/lib/Form/DeleteCalendar.php
Expand Up @@ -28,7 +28,7 @@ public function __construct($vars, $calendar)
parent::__construct($vars, sprintf(_("Delete %s"), $calendar->get('name')));

$this->addHidden('', 'c', 'text', true);
$this->addVariable(sprintf(_("Really delete the calendar \"%s\"? This cannot be undone and all data on this calendar will be permanently removed."), $this->_calendar->get('name')), 'desc', 'description', false);
$this->addVariable(sprintf(_("Really delete the calendar \"%s\"? This cannot be undone and all data on this calendar will be permanently removed."), htmlspecialchars($this->_calendar->get('name'))), 'desc', 'description', false);

$this->setButtons(array(
array('class' => 'horde-delete', 'value' => _("Delete")),
Expand Down
2 changes: 1 addition & 1 deletion kronolith/lib/Form/DeleteResource.php
Expand Up @@ -31,7 +31,7 @@ public function __construct($vars, $resource)
parent::__construct($vars, sprintf(_("Delete %s"), $resource->get('name')));

$this->addHidden('', 'c', 'text', true);
$this->addVariable(sprintf(_("Really delete the resource \"%s\"? This cannot be undone and all data on this resource will be permanently removed."), $this->_resource->get('name')), 'desc', 'description', false);
$this->addVariable(sprintf(_("Really delete the resource \"%s\"? This cannot be undone and all data on this resource will be permanently removed."), htmlspecialchars($this->_resource->get('name'))), 'desc', 'description', false);

$this->setButtons(array(
array('class' => 'horde-delete', 'value' => _("Delete")),
Expand Down
2 changes: 1 addition & 1 deletion kronolith/lib/Form/DeleteResourceGroup.php
Expand Up @@ -32,7 +32,7 @@ public function __construct($vars, $resource)

$this->addHidden('', 'c', 'text', true);
$this->addVariable(
sprintf(_("Really delete the resource \"%s\"? This cannot be undone and all data on this resource will be permanently removed."), $this->_resource->get('name')),
sprintf(_("Really delete the resource \"%s\"? This cannot be undone and all data on this resource will be permanently removed."), htmlspecialchars($this->_resource->get('name'))),
'desc', 'description', false);

$this->setButtons(array(
Expand Down
2 changes: 1 addition & 1 deletion kronolith/lib/Form/UnsubscribeRemoteCalendar.php
Expand Up @@ -22,7 +22,7 @@ public function __construct($vars, $calendar)
parent::__construct($vars, sprintf(_("Unsubscribe from %s"), $calendar['name']));

$this->addHidden('', 'url', 'text', true);
$this->addVariable(sprintf(_("Really unsubscribe from the calendar \"%s\" (%s)?"), $calendar['name'], $calendar['url']), 'desc', 'description', false);
$this->addVariable(sprintf(_("Really unsubscribe from the calendar \"%s\" (%s)?"), htmlspecialchars($calendar['name']), htmlspecialchars($calendar['url'])), 'desc', 'description', false);

$this->setButtons(array(
array('class' => 'horde-delete', 'value' => _("Unsubscribe")),
Expand Down
2 changes: 2 additions & 0 deletions kronolith/package.xml
Expand Up @@ -34,6 +34,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] SECURITY: Fix XSS vulnerabilities when deleting calendars and resources.
* [jan] Fix edge case that allowed to enter start time after end time (Bug #12752).
* [mjr] Expire fb cache when fb_cals preference changes (Bug #12714).
* [jan] Fix setting DTEND in iCalendar data if event has a timezone (Bug #12693).
Expand Down Expand Up @@ -2224,6 +2225,7 @@
<date>2013-08-28</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] SECURITY: Fix XSS vulnerabilities when deleting calendars and resources.
* [jan] Fix edge case that allowed to enter start time after end time (Bug #12752).
* [mjr] Expire fb cache when fb_cals preference changes (Bug #12714).
* [jan] Fix setting DTEND in iCalendar data if event has a timezone (Bug #12693).
Expand Down
1 change: 1 addition & 0 deletions mnemo/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.1.2-git
----------

[jan] SECURITY: Fix XSS vulnerabilities when deleting notepads.
[mjr] Fix removing a list of UIDs via the API (Bug #12790,
thomas.jarosch@intra2net.com)
[mjr] Fix exporting memos as v-note (horde@albasoft.com, Bug #12622).
Expand Down
2 changes: 1 addition & 1 deletion mnemo/lib/Form/DeleteNotepad.php
Expand Up @@ -29,7 +29,7 @@ public function __construct(&$vars, $notepad)
parent::__construct($vars, sprintf(_("Delete %s"), $notepad->get('name')));

$this->addHidden('', 'n', 'text', true);
$this->addVariable(sprintf(_("Really delete the notepad \"%s\"? This cannot be undone and all data on this notepad will be permanently removed."), $this->_notepad->get('name')), 'desc', 'description', false);
$this->addVariable(sprintf(_("Really delete the notepad \"%s\"? This cannot be undone and all data on this notepad will be permanently removed."), htmlspecialchars($this->_notepad->get('name'))), 'desc', 'description', false);

$this->setButtons(array(
array('class' => 'horde-delete', 'value' => _("Delete")),
Expand Down
2 changes: 2 additions & 0 deletions mnemo/package.xml
Expand Up @@ -28,6 +28,7 @@
</stability>
<license uri="http://www.horde.org/licenses/apache">ASL</license>
<notes>
* [jan] SECURITY: Fix XSS vulnerabilities when deleting notepads.
* [mjr] Fix removing a list of UIDs via the API (Bug #12790, thomas.jarosch@intra2net.com)
* [mjr] Fix exporting memos as v-note (horde@albasoft.com, Bug #12622).
</notes>
Expand Down Expand Up @@ -1068,6 +1069,7 @@
<date>2013-07-16</date>
<license uri="http://www.horde.org/licenses/apache">ASL</license>
<notes>
* [jan] SECURITY: Fix XSS vulnerabilities when deleting notepads.
* [mjr] Fix removing a list of UIDs via the API (Bug #12790, thomas.jarosch@intra2net.com)
* [mjr] Fix exporting memos as v-note (horde@albasoft.com, Bug #12622).
</notes>
Expand Down
1 change: 1 addition & 0 deletions nag/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.1.3-git
----------

[jan] SECURITY: Fix XSS vulnerabilities when deleting task lists.
[jan] Fix updating alarm if completing a task recurrence.
[jan] Fix editing tasks via CalDAV (Bug #12745).

Expand Down
2 changes: 1 addition & 1 deletion nag/lib/Form/DeleteTaskList.php
Expand Up @@ -36,7 +36,7 @@ public function __construct($vars, Horde_Share_Object $tasklist)
$this->addHidden('', 't', 'text', true);
$this->addVariable(
sprintf(_("Really delete the task list \"%s\"? This cannot be undone and all data on this task list will be permanently removed."),
$this->_tasklist->get('name')), 'desc', 'description', false
htmlspecialchars($this->_tasklist->get('name'))), 'desc', 'description', false
);
$this->setButtons(array(
array('class' => 'horde-delete', 'value' => _("Delete")),
Expand Down
2 changes: 2 additions & 0 deletions nag/package.xml
Expand Up @@ -34,6 +34,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] SECURITY: Fix XSS vulnerabilities when deleting task lists.
* [jan] Fix updating alarm if completing a task recurrence.
* [jan] Fix editing tasks via CalDAV (Bug #12745).
</notes>
Expand Down Expand Up @@ -1421,6 +1422,7 @@
<date>2013-08-27</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] SECURITY: Fix XSS vulnerabilities when deleting task lists.
* [jan] Fix updating alarm if completing a task recurrence.
* [jan] Fix editing tasks via CalDAV (Bug #12745).
</notes>
Expand Down
1 change: 1 addition & 0 deletions turba/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.1.3-git
----------

[jan] SECURITY: Fix XSS vulnerabilities when deleting address books.
[jan] Fix exporting selected contacts (Bug #12759).
[mms] Improved UI when viewing search results from Advanced Search.
[mms] Remove features from UI when VFS is not available or disabled.
Expand Down
2 changes: 1 addition & 1 deletion turba/lib/Form/DeleteAddressBook.php
Expand Up @@ -28,7 +28,7 @@ public function __construct($vars, $addressbook)
parent::__construct($vars, sprintf(_("Delete %s"), $addressbook->get('name')));

$this->addHidden('', 'a', 'text', true);
$this->addVariable(sprintf(_("Really delete the address book \"%s\"? This cannot be undone and all contacts in this address book will be permanently removed."), $this->_addressbook->get('name')), 'desc', 'description', false);
$this->addVariable(sprintf(_("Really delete the address book \"%s\"? This cannot be undone and all contacts in this address book will be permanently removed."), htmlspecialchars($this->_addressbook->get('name'))), 'desc', 'description', false);

$this->setButtons(array(
array('class' => 'horde-delete', 'value' => _("Delete")),
Expand Down
2 changes: 2 additions & 0 deletions turba/package.xml
Expand Up @@ -40,6 +40,7 @@
</stability>
<license uri="http://www.horde.org/licenses/asl">ASL</license>
<notes>
* [jan] SECURITY: Fix XSS vulnerabilities when deleting address books.
* [jan] Fix exporting selected contacts (Bug #12759).
* [mms] Improved UI when viewing search results from Advanced Search.
* [mms] Remove features from UI when VFS is not available or disabled.
Expand Down Expand Up @@ -1700,6 +1701,7 @@
<date>2013-08-27</date>
<license uri="http://www.horde.org/licenses/asl">ASL</license>
<notes>
* [jan] SECURITY: Fix XSS vulnerabilities when deleting address books.
* [jan] Fix exporting selected contacts (Bug #12759).
* [mms] Improved UI when viewing search results from Advanced Search.
* [mms] Remove features from UI when VFS is not available or disabled.
Expand Down

0 comments on commit 30bc1d0

Please sign in to comment.