Skip to content

Commit

Permalink
Fix Multiple Stored XSS in Administration allowing execution of arbit…
Browse files Browse the repository at this point in the history
…rary JavaScript code (#1260)

Add escape:"html" when rendering data on FE 

Fix bug stored XSS - Data when render on FE allows execution of arbitrary javascript code

Disclosure: https://huntr.dev/bounties/cc5c6cdd-8030-4eb1-af75-947780ee12e0
  • Loading branch information
noobpk committed Nov 15, 2021
1 parent 062389e commit a4b6fd7
Show file tree
Hide file tree
Showing 39 changed files with 74 additions and 72 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,8 @@

See [Upgrading] for details on how to upgrade.

- Fix Multiple Stored XSS in Administration allowing execution of arbitrary JavaScript code, #1260

[3.10.9]: https://github.com/eventum/eventum/compare/v3.10.8...master

## [3.10.8] - 2021-11-10
Expand Down
2 changes: 1 addition & 1 deletion templates/adv_search.tpl.html
Expand Up @@ -372,7 +372,7 @@
{if $core.current_role < $core.roles.manager and $custom[i].cst_is_global}
{$custom[i].cst_title}
{else}
<a href="adv_search.php?custom_id={$custom[i].cst_id}" title="{t}edit this custom search{/t}">{$custom[i].cst_title}</a>
<a href="adv_search.php?custom_id={$custom[i].cst_id}" title="{t}edit this custom search{/t}">{$custom[i].cst_title|escape:"html"}</a>
{/if}
</span>
{if $custom[i].cst_is_global}<span><i>({t}global filter{/t})</i></span>{/if}
Expand Down
2 changes: 1 addition & 1 deletion templates/custom_fields.tpl.html
Expand Up @@ -11,7 +11,7 @@
{section name="i" loop=$custom_fields}
<tr class="{cycle values='odd,even'}" {if $custom_fields[i].hide_when_no_options|default:0 == 1 && $custom_fields[i].value == ''}style="display: none"{/if}>
<th class="{if $custom_fields[i].fld_min_role > $core.roles.customer}internal{/if}">
{$custom_fields[i].fld_title}
{$custom_fields[i].fld_title|escape:"html"}
</th>
<td>
{if $custom_fields[i].fld_type == 'textarea'}
Expand Down
4 changes: 2 additions & 2 deletions templates/edit_custom_fields.tpl.html
Expand Up @@ -18,11 +18,11 @@
<tr class="custom_field"
data-custom-id="{$custom_fields[i].fld_id}"
data-custom-type="{$custom_fields[i].fld_type}"
data-custom-title="{$custom_fields[i].fld_title}"
data-custom-title="{$custom_fields[i].fld_title|escape:'html'}"
data-custom-required="{$cf_required}"
data-custom-validation-js="{$custom_fields[i].validation_js|default:''}">
<th class="{if $custom_fields[i].fld_min_role > $core.roles.customer}internal{/if}">
{$custom_fields[i].fld_title}{if $cf_required} *{/if}
{$custom_fields[i].fld_title|escape:"html"}{if $cf_required} *{/if}
</th>
<td>
{if $custom_fields[i].fld_type == 'text'}
Expand Down
2 changes: 1 addition & 1 deletion templates/faq.tpl.html
Expand Up @@ -34,7 +34,7 @@
</tr>
{section name="i" loop=$faqs}
<tr class="{cycle values='odd,even'}">
<td><b><a href="faq.php?id={$faqs[i].faq_id}" title="{t}read faq entry{/t}">{$faqs[i].faq_title}</a></b></td>
<td><b><a href="faq.php?id={$faqs[i].faq_id}" title="{t}read faq entry{/t}">{$faqs[i].faq_title|escape:"html"}</a></b></td>
<td>{$faqs[i].faq_updated_date|timeago}</td>
</tr>
{/section}
Expand Down
2 changes: 1 addition & 1 deletion templates/include/new_form.tpl.html
Expand Up @@ -47,7 +47,7 @@
<tr class="title">
<th colspan="2">
{t}Create New Issue{/t}
<span class="menu">({t}Current Project{/t}: {$core.project_name})</span>
<span class="menu">({t}Current Project{/t}: {$core.project_name|escape:'html'})</span>
</th>
</tr>
{if $cats|@count > 0 && $core.current_role >= $field_display_settings.category.min_role}
Expand Down
2 changes: 1 addition & 1 deletion templates/latest_news.tpl.html
Expand Up @@ -9,7 +9,7 @@
<tr>
<td>
{section name="i" loop=$news}
<b>{$news[i].nws_created_date|timeago} - <a href="news.php?id={$news[i].nws_id}" title="{t}full news entry{/t}">{$news[i].nws_title}</a></b>
<b>{$news[i].nws_created_date|timeago} - <a href="news.php?id={$news[i].nws_id}" title="{t}full news entry{/t}">{$news[i].nws_title|escape:"html"}</a></b>
<br /><br />
{$news[i].nws_message|activateLinks:"links"}
<br /><br />
Expand Down
6 changes: 3 additions & 3 deletions templates/list.tpl.html
Expand Up @@ -105,13 +105,13 @@
{elseif $field_name == 'sev_rank'}
{$list[i].sev_title|escape:"html"}
{elseif $field_name == 'grp_name'}
{$list[i].grp_name}
{$list[i].grp_name|escape:"html"}
{elseif $field_name == 'assigned'}
{$list[i].assigned_users}
{$list[i].assigned_users|escape:"html"}
{elseif $field_name == 'time_spent'}
{$list[i].time_spent}
{elseif $field_name == 'prc_title'}
{$list[i].prc_title}
{$list[i].prc_title|escape:"html"}
{elseif $field_name == 'pre_title'}
{$list[i].pre_title|escape:"html"}
{elseif $field_name == 'iss_customer_id'}
Expand Down
2 changes: 1 addition & 1 deletion templates/manage/anonymous.tpl.html
Expand Up @@ -61,7 +61,7 @@
<tr class="title">
<th colspan="2">
{t}Anonymous Reporting of New Issues{/t}
<div class="right">({t}Current Project{/t}: {$project.prj_title})</div>
<div class="right">({t}Current Project{/t}: {$project.prj_title|escape:"html"})</div>
</th>
</tr>
<tr>
Expand Down
6 changes: 3 additions & 3 deletions templates/manage/categories.tpl.html
Expand Up @@ -47,7 +47,7 @@
<th colspan="2">
{t}Manage Categories{/t}
<div class="right">
({t}Current Project{/t}: {$project.prj_title})
({t}Current Project{/t}: {$project.prj_title|escape:"html"})
</div>
</th>
</tr>
Expand All @@ -56,7 +56,7 @@
{t}Title{/t}: *
</th>
<td>
<input type="text" name="title" size="40" value="{$info.prc_title|default:''}">
<input type="text" name="title" size="40" value="{$info.prc_title|default:''|escape:'html'}">
{include file="error_icon.tpl.html" field="title"}
</td>
</tr>
Expand Down Expand Up @@ -90,7 +90,7 @@
<tr class="{cycle values='odd,even'}">
<td width="4" nowrap align="center"><input type="checkbox" name="items[]" value="{$list[i].prc_id}"></td>
<td width="100%">
&nbsp;<a href="{$core.rel_url}manage/categories.php?cat=edit&id={$list[i].prc_id}&prj_id={$project.prj_id}" title="{t}update this entry{/t}">{$list[i].prc_title}</a>
&nbsp;<a href="{$core.rel_url}manage/categories.php?cat=edit&id={$list[i].prc_id}&prj_id={$project.prj_id}" title="{t}update this entry{/t}">{$list[i].prc_title|escape:"html"}</a>
</td>
</tr>
{sectionelse}
Expand Down
2 changes: 1 addition & 1 deletion templates/manage/column_display.tpl.html
Expand Up @@ -15,7 +15,7 @@
<tr class="title">
<th colspan="3">
{t}Manage Columns to Display{/t} {include file="help_link.tpl.html" topic="column_display"}
<div class="right">({t}Current Project{/t}: {$project_name})</div>
<div class="right">({t}Current Project{/t}: {$project_name|escape:"html"})</div>
</th>
</tr>
<tr>
Expand Down
12 changes: 6 additions & 6 deletions templates/manage/custom_fields.tpl.html
Expand Up @@ -220,7 +220,7 @@
{t}Title{/t}
</th>
<td>
<input type="text" name="title" maxlength="255" size="40" value="{$info.fld_title|default:''}">
<input type="text" name="title" maxlength="255" size="40" value="{$info.fld_title|default:''|escape:'html'}">
{include file="error_icon.tpl.html" field="title"}
</td>
</tr>
Expand All @@ -229,7 +229,7 @@
{t}Short Description{/t}
</th>
<td>
<input type="text" name="description" maxlength="255" size="40" value="{$info.fld_description|default:''}">
<input type="text" name="description" maxlength="255" size="40" value="{$info.fld_description|default:''|escape:'html'}">
<span>({t}it will show up by the side of the field{/t})</span>
</td>
</tr>
Expand Down Expand Up @@ -419,16 +419,16 @@
{rank_icon href="{$core.rel_url}manage/custom_fields.php?cat=change_rank&id={$list[i].fld_id}&direction=-1" direction="up"}
</td>
<td width="15%">
&nbsp;<a href="{$core.rel_url}manage/custom_fields.php?cat=edit&id={$list[i].fld_id}" title="{t}update this entry{/t}">{$list[i].fld_title}</a>
&nbsp;<a href="{$core.rel_url}manage/custom_fields.php?cat=edit&id={$list[i].fld_id}" title="{t}update this entry{/t}">{$list[i].fld_title|escape:"html"}</a>
</td>
<td width="20%">
&nbsp;{$list[i].projects}
&nbsp;{$list[i].projects|escape:"html"}
</td>
<td width="10%">
&nbsp;{$list[i].min_role_name}
&nbsp;{$list[i].min_role_name|escape:"html"}
</td>
<td width="10%">
&nbsp;{$list[i].min_role_edit_name}
&nbsp;{$list[i].min_role_edit_name|escape:"html"}
</td>
<td width="5%">
<nobr>&nbsp;{if $list[i].fld_type == 'combo'}{t}Combo Box{/t}{elseif $list[i].fld_type == 'multiple'}{t}Multiple Combo Box{/t}{elseif $list[i].fld_type == 'textarea'}{t}Textarea{/t}{elseif $list[i].fld_type == 'date'}{t}Date{/t}{elseif $list[i].fld_type == 'integer'}{t}Integer{/t}{elseif $list[i].fld_type == 'checkbox'}Checkbox{else}{t}Text Input{/t}{/if}</nobr>
Expand Down
2 changes: 1 addition & 1 deletion templates/manage/email_accounts.tpl.html
Expand Up @@ -244,7 +244,7 @@
{section name="i" loop=$list}
<tr class="{cycle values='odd,even'}">
<td width="4" align="center" nowrap><input type="checkbox" name="items[]" value="{$list[i].ema_id}"></td>
<td>&nbsp;{$list[i].prj_title}</td>
<td>&nbsp;{$list[i].prj_title|escape:"html"}</td>
<td width="30%">
&nbsp;<a href="{$core.rel_url}manage/email_accounts.php?cat=edit&id={$list[i].ema_id}" title="{t}update this entry{/t}">{$list[i].ema_hostname|escape:"html"}</a></td>
<td>&nbsp;{$list[i].ema_type}</td>
Expand Down
2 changes: 1 addition & 1 deletion templates/manage/email_responses.tpl.html
Expand Up @@ -115,7 +115,7 @@
<tr class="{cycle values='odd,even'}">
<td width="4" nowrap align="center"><input type="checkbox" name="items[]" value="{$list[i].ere_id}"></td>
<td width="60%">
&nbsp;<a href="{$core.rel_url}manage/email_responses.php?cat=edit&id={$list[i].ere_id}" title="{t}update this entry{/t}">{$list[i].ere_title}</a>
&nbsp;<a href="{$core.rel_url}manage/email_responses.php?cat=edit&id={$list[i].ere_id}" title="{t}update this entry{/t}">{$list[i].ere_title|escape:"html"}</a>
</td>
<td width="40%">
&nbsp;{$list[i].projects|escape:"html"}
Expand Down
12 changes: 6 additions & 6 deletions templates/manage/groups.tpl.html
Expand Up @@ -73,7 +73,7 @@
{t}Name{/t} *
</th>
<td>
<input type="text" name="group_name" size="40" value="{$info.grp_name|default:''}">
<input type="text" name="group_name" size="40" value="{$info.grp_name|default:''|escape:'html'}">
{include file="error_icon.tpl.html" field="group_name"}
</td>
</tr>
Expand All @@ -82,7 +82,7 @@
{t}Description{/t}
</th>
<td>
<input type="text" name="description" size="100" value="{$info.grp_description|default:''}">
<input type="text" name="description" size="100" value="{$info.grp_description|default:''|escape:'html'}">
{include file="error_icon.tpl.html" field="description"}
</td>
</tr>
Expand Down Expand Up @@ -155,16 +155,16 @@
<input type="checkbox" name="items[]" value="{$list[i].grp_id}" {if $smarty.section.i.total == 0}disabled{/if}>
</td>
<td width="20%">
&nbsp;<a href="{$core.rel_url}manage/groups.php?cat=edit&id={$list[i].grp_id}" title="{t}update this entry{/t}">{$list[i].grp_name}</a>
&nbsp;<a href="{$core.rel_url}manage/groups.php?cat=edit&id={$list[i].grp_id}" title="{t}update this entry{/t}">{$list[i].grp_name|escape:"html"}</a>
</td>
<td width="20%">
&nbsp;{$list[i].grp_description}
&nbsp;{$list[i].grp_description|escape:"html"}
</td>
<td width="40%">
&nbsp;{$list[i].manager}
&nbsp;{$list[i].manager|escape:"html"}
</td>
<td width="20%">
&nbsp;{", "|join:$list[i].projects}
&nbsp;{", "|join:$list[i].projects|escape:"html"}
</td>
</tr>
{sectionelse}
Expand Down
2 changes: 1 addition & 1 deletion templates/manage/issue_auto_creation.tpl.html
Expand Up @@ -50,7 +50,7 @@
<tr class="title">
<th colspan="2">
{t}Auto-Creation of Issues{/t}
<div class="right">({t}Associated Project{/t}: {$prj_title})</div>
<div class="right">({t}Associated Project{/t}: {$prj_title|escape:"html"})</div>
</th>
</tr>
<tr>
Expand Down
6 changes: 3 additions & 3 deletions templates/manage/link_filters.tpl.html
Expand Up @@ -150,13 +150,13 @@
&nbsp;{$list[i].lfi_replacement|escape:"html"}
</td>
<td width="20%">
&nbsp;{$list[i].lfi_description}
&nbsp;{$list[i].lfi_description|escape:"html"}
</td>
<td width="20%">
&nbsp;{$list[i].min_usr_role_name}
&nbsp;{$list[i].min_usr_role_name|escape:"html"}
</td>
<td width="20%">
&nbsp;{", "|join:$list[i].project_names}
&nbsp;{", "|join:$list[i].project_names|escape:"html"}
</td>
</tr>
{sectionelse}
Expand Down
2 changes: 1 addition & 1 deletion templates/manage/news.tpl.html
Expand Up @@ -133,7 +133,7 @@
<tr class="{cycle values='odd,even'}">
<td width="4" nowrap align="center"><input type="checkbox" name="items[]" value="{$list[i].nws_id}"></td>
<td width="40%">
&nbsp;<a href="{$core.rel_url}manage/news.php?cat=edit&id={$list[i].nws_id}" title="{t}update this entry{/t}">{$list[i].nws_title}</a>
&nbsp;<a href="{$core.rel_url}manage/news.php?cat=edit&id={$list[i].nws_id}" title="{t}update this entry{/t}">{$list[i].nws_title|escape:"html"}</a>
</td>
<td width="40%">
&nbsp;{$list[i].projects|escape:"html"}
Expand Down
6 changes: 3 additions & 3 deletions templates/manage/phone_categories.tpl.html
Expand Up @@ -46,15 +46,15 @@
<tr class="title">
<th colspan="2">
{t}Manage Phone Support Categories{/t}
<div class="right">({t}Current Project{/t}: {$project.prj_title})</div>
<div class="right">({t}Current Project{/t}: {$project.prj_title|escape:"html"})</div>
</th>
</tr>
<tr>
<th width="120">
{t}Title{/t}: *
</th>
<td>
<input type="text" name="title" size="40" value="{$info.phc_title|default:''}">
<input type="text" name="title" size="40" value="{$info.phc_title|default:''|escape:'html'}">
{include file="error_icon.tpl.html" field="title"}
</td>
</tr>
Expand Down Expand Up @@ -88,7 +88,7 @@
<tr class="{cycle values='odd,even'}">
<td width="4" nowrap align="center"><input type="checkbox" name="items[]" value="{$list[i].phc_id}"></td>
<td width="100%">
&nbsp;<a href="{$core.rel_url}manage/phone_categories.php?cat=edit&id={$list[i].phc_id}&prj_id={$project.prj_id}" title="{t}update this entry{/t}">{$list[i].phc_title}</a>
&nbsp;<a href="{$core.rel_url}manage/phone_categories.php?cat=edit&id={$list[i].phc_id}&prj_id={$project.prj_id}" title="{t}update this entry{/t}">{$list[i].phc_title|escape:"html"}</a>
</td>
</tr>
{sectionelse}
Expand Down
6 changes: 3 additions & 3 deletions templates/manage/priorities.tpl.html
Expand Up @@ -79,7 +79,7 @@
<th colspan="2">
{t}Manage Priorities{/t}
<div class="right">
({t}Current Project{/t}: {$project.prj_title})
({t}Current Project{/t}: {$project.prj_title|escape:"html"})
</div>
</th>
</tr>
Expand All @@ -88,7 +88,7 @@
{t}Title{/t}: *
</th>
<td>
<input type="text" name="title" size="40" value="{$info.pri_title|default:''}">
<input type="text" name="title" size="40" value="{$info.pri_title|default:''|escape:'html'}">
{include file="error_icon.tpl.html" field="title"}
</td>
</tr>
Expand Down Expand Up @@ -154,7 +154,7 @@
{if $list[i].pri_icon > 0}<span class="priority_icon priority-icon-{$list[i].pri_icon}" title="{$list[i].pri_icon}"></span>{/if}
</td>
<td width="100%">
&nbsp;<a href="{$core.rel_url}manage/priorities.php?cat=edit&id={$list[i].pri_id}&prj_id={$project.prj_id}" title="{t}update this entry{/t}">{$list[i].pri_title}</a>
&nbsp;<a href="{$core.rel_url}manage/priorities.php?cat=edit&id={$list[i].pri_id}&prj_id={$project.prj_id}" title="{t}update this entry{/t}">{$list[i].pri_title|escape:"html"}</a>
</td>
</tr>
{sectionelse}
Expand Down
2 changes: 1 addition & 1 deletion templates/manage/products.tpl.html
Expand Up @@ -57,7 +57,7 @@
{t}Title{/t} *
</th>
<td>
<input type="text" name="title" size="40" value="{$info.pro_title|default:''}">
<input type="text" name="title" size="40" value="{$info.pro_title|default:''|escape:'html'}">
{include file="error_icon.tpl.html" field="title"}
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion templates/manage/projects.tpl.html
Expand Up @@ -271,7 +271,7 @@
{section name="i" loop=$list}
<tr class="{cycle values='odd,even'}">
<td width="30%" >
&nbsp;<a href="{$core.rel_url}manage/projects.php?cat=edit&id={$list[i].prj_id}" title="{t}update this entry{/t}">{$list[i].prj_title}</a>
&nbsp;<a href="{$core.rel_url}manage/projects.php?cat=edit&id={$list[i].prj_id}" title="{t}update this entry{/t}">{$list[i].prj_title|escape:"html"}</a>
</td>
<td width="20%" >&nbsp;{$list[i].usr_full_name|escape:html}</td>
<td >&nbsp;{$list[i].prj_status|capitalize}</td>
Expand Down
6 changes: 3 additions & 3 deletions templates/manage/releases.tpl.html
Expand Up @@ -47,7 +47,7 @@
<th colspan="2">
{t}Manage Releases{/t}
<div class="right">
({t}Current Project{/t}: {$project.prj_title})
({t}Current Project{/t}: {$project.prj_title|escape:"html"})
</div>
</th>
</tr>
Expand All @@ -56,7 +56,7 @@
{t}Title{/t}:
</th>
<td>
<input type="text" name="title" size="40" value="{$info.pre_title|default:''}">
<input type="text" name="title" size="40" value="{$info.pre_title|default:''|escape:'html'}">
{include file="error_icon.tpl.html" field="title"}
</td>
</tr>
Expand Down Expand Up @@ -111,7 +111,7 @@
<tr class="{cycle values='odd,even'}">
<td width="4" nowrap align="center"><input type="checkbox" name="items[]" value="{$list[i].pre_id}"></td>
<td width="40%">
&nbsp;<a href="{$core.rel_url}manage/releases.php?cat=edit&id={$list[i].pre_id}&prj_id={$project.prj_id}" title="{t}update this entry{/t}">{$list[i].pre_title}</a>
&nbsp;<a href="{$core.rel_url}manage/releases.php?cat=edit&id={$list[i].pre_id}&prj_id={$project.prj_id}" title="{t}update this entry{/t}">{$list[i].pre_title|escape:"html"}</a>
</td>
<td>&nbsp;{$list[i].pre_scheduled_date}</td>
<td>&nbsp;{$list[i].pre_status}</td>
Expand Down
4 changes: 2 additions & 2 deletions templates/manage/resolution.tpl.html
Expand Up @@ -57,7 +57,7 @@
{t}Title{/t}:
</th>
<td>
<input type="text" name="title" size="40" value="{$info.res_title|default:''}">
<input type="text" name="title" size="40" value="{$info.res_title|default:''|escape:'html'}">
{include file="error_icon.tpl.html" field="title"}
</td>
</tr>
Expand Down Expand Up @@ -101,7 +101,7 @@
<td width="4" nowrap align="center"><input type="checkbox" name="items[]" value="{$list[i].res_id}"></td>
<td align="center">{$list[i].res_rank}</td>
<td width="100%">
&nbsp;<a href="{$core.rel_url}manage/resolution.php?cat=edit&id={$list[i].res_id}" title="{t}update this entry{/t}">{$list[i].res_title}</a>
&nbsp;<a href="{$core.rel_url}manage/resolution.php?cat=edit&id={$list[i].res_id}" title="{t}update this entry{/t}">{$list[i].res_title|escape:"html"}</a>
</td>
</tr>
{sectionelse}
Expand Down
2 changes: 1 addition & 1 deletion templates/manage/round_robin.tpl.html
Expand Up @@ -131,7 +131,7 @@
<tr class="{cycle values="odd,even"}">
<td width="4" nowrap align="center"><input type="checkbox" name="items[]" value="{$list[i].prr_id}"></td>
<td width="30%">
&nbsp;<a href="{$core.rel_url}manage/round_robin.php?cat=edit&id={$list[i].prr_id}" title="{t}update this entry{/t}">{$list[i].prj_title}</a>
&nbsp;<a href="{$core.rel_url}manage/round_robin.php?cat=edit&id={$list[i].prr_id}" title="{t}update this entry{/t}">{$list[i].prj_title|escape:"html"}</a>
</td>
<td width="70%">
&nbsp;{$list[i].users|escape:"html"}
Expand Down

0 comments on commit a4b6fd7

Please sign in to comment.