gitweb: Introduce esc_attr to escape attributes of HTML elements
commit7eb9e4021b9007ef44326a6ba9fa3063bebad0b1
authorJakub Narebski <jnareb@gmail.com>
Tue, 14 Dec 2010 23:34:01 +0000 (15 00:34 +0100)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 24 Apr 2013 15:53:05 +0000 (24 08:53 -0700)
tree2db0d3eaf4e3fa31d3853d83aa2a3b0734ec79f8
parent297f955c86062613dec16839547bef6071cc2491
gitweb: Introduce esc_attr to escape attributes of HTML elements

It is needed only to escape attributes of handcrafted HTML elements,
and not those generated using CGI.pm subroutines / methods for HTML
generation.

While at it, add esc_url and esc_html where needed, and prefer to use
CGI.pm HTML generating methods than handcrafted HTML code.  Most of
those are probably unnecessary (could be exploited only by person with
write access to gitweb config, or at least access to the repository).

This fixes CVE-2010-3906

Reported-by: Emanuele Gentili <e.gentili@tigersecurity.it>
Helped-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Conflicts:
gitweb/gitweb.perl
gitweb/gitweb.perl