Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7df30a9

Browse files
committedJan 18, 2013
Fix #15384: summary.php XSS vulnerability in MantisBT 1.2.12 only
Roland Becker (MantisBT Developer) discovered a XSS vulnerability introduced in MantisBT 1.2.12 with the display of category/project names on the summary.php page. A malicious MantisBT user holding privileged manager/administrator permissions could create a category or project name that contains JavaScript code. Any user visiting summary.php from that point on may then be exposed to having the malicious JavaScript execute within their browser environment. The severity of this issue is limited by the need to hold privileged manager/administrator permissions in order to modify category and project names. However -- there are many use cases where MantisBT installations can have hundreds of sub-projects, each managed by different people/parties that can not or should not be fully trusted. Refer to previous commits 3ca8a16 and 6ec3f69 to trace back the origin of this vulnerability.
1 parent 610da6e commit 7df30a9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎core/summary_api.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,9 @@ function summary_print_by_category() {
626626
$v_category_name = $row['category_name'];
627627

628628
if(( $v_category_name != $last_category_name ) && ( $last_category_name != -1 ) ) {
629-
$label = $last_category_name;
629+
$label = string_display_line( $last_category_name );
630630
if(( ON == $t_summary_category_include_project ) && ( ALL_PROJECTS == $t_project_id ) ) {
631-
$label = sprintf( '[%s] %s', project_get_name( $last_project ), $label );
631+
$label = sprintf( '[%s] %s', string_display_line( project_get_name( $last_project ) ), $label );
632632
}
633633

634634
$t_bug_link = '<a class="subtle" href="' . config_get( 'bug_count_hyperlink_prefix' ) . '&amp;' . FILTER_PROPERTY_CATEGORY . '=' . urlencode( $last_category_name );
@@ -671,9 +671,9 @@ function summary_print_by_category() {
671671
}
672672

673673
if( 0 < $t_bugs_total ) {
674-
$label = $last_category_name;
674+
$label = string_display_line( $last_category_name );
675675
if(( ON == $t_summary_category_include_project ) && ( ALL_PROJECTS == $t_project_id ) ) {
676-
$label = sprintf( '[%s] %s', project_get_name( $last_project ), $label );
676+
$label = sprintf( '[%s] %s', string_display_line( project_get_name( $last_project ) ), $label );
677677
}
678678

679679
$t_bug_link = '<a class="subtle" href="' . config_get( 'bug_count_hyperlink_prefix' ) . '&amp;' . FILTER_PROPERTY_CATEGORY . '=' . urlencode( $last_category_name );
@@ -753,7 +753,7 @@ function summary_print_by_project( $p_projects = null, $p_level = 0, $p_cache =
753753
}
754754

755755
foreach( $p_projects as $t_project ) {
756-
$t_name = str_repeat( "&raquo; ", $p_level ) . project_get_name( $t_project );
756+
$t_name = str_repeat( "&raquo; ", $p_level ) . string_display_line( project_get_name( $t_project ) );
757757

758758
$t_pdata = isset( $p_cache[$t_project] ) ? $p_cache[$t_project] : array( 'open' => 0, 'resolved' => 0, 'closed' => 0 );
759759

0 commit comments

Comments
 (0)
Please sign in to comment.