Skip to content

Commit 77947bb

Browse files
abrauchligitster
authored andcommitted
gitweb: escape link body in format_ref_marker
Fix a case where an html link can be generated from unescaped input resulting in invalid strict xhtml or potentially injected code. An overview of a repo with a tag "1.0.0&0.0.1" would previously result in an unescaped ampersand in the link body. Signed-off-by: Andreas Brauchli <[email protected]> Acked-by: Jakub Narębski <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0b65a8d commit 77947bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gitweb/gitweb.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,7 @@ sub format_ref_marker {
20902090
-href => href(
20912091
action=>$dest_action,
20922092
hash=>$dest
2093-
)}, $name);
2093+
)}, esc_html($name));
20942094

20952095
$markers .= " <span class=\"".esc_attr($class)."\" title=\"".esc_attr($ref)."\">" .
20962096
$link . "</span>";

0 commit comments

Comments
 (0)