Browse Source

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 <a.brauchli@elementarea.net>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Andreas Brauchli 9 years ago committed by Junio C Hamano
parent
commit
77947bbe24
  1. 2
      gitweb/gitweb.perl

2
gitweb/gitweb.perl

@ -2090,7 +2090,7 @@ sub format_ref_marker { @@ -2090,7 +2090,7 @@ sub format_ref_marker {
-href => href(
action=>$dest_action,
hash=>$dest
)}, $name);
)}, esc_html($name));

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

Loading…
Cancel
Save