X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/bb9db3a422e701cef902d1018a4ad87102f4711080b7e323995fdd9802d60884..2ea1d67c50c405bb76e471563bf87ed8643aa905469e8c8c9630b81d5eea0d24:/gitweb.perl diff --git a/gitweb.perl b/gitweb.perl index 913edb1..062cf8b 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -133,6 +133,10 @@ our $fallback_encoding = 'latin1'; # - one might want to include '-B' option, e.g. '-B', '-M' our @diff_opts = ('-M'); # taken from git_commit +# Disables features that would allow repository owners to inject script into +# the gitweb domain. +our $prevent_xss = 0; + # information about snapshot formats that gitweb is capable of serving our %known_snapshot_formats = ( # name => { @@ -4504,7 +4508,9 @@ sub git_summary { print "\n"; - if (-s "$projectroot/$project/README.html") { + # If XSS prevention is on, we don't include README.html. + # TODO: Allow a readme in some safe format. + if (!$prevent_xss && -s "$projectroot/$project/README.html") { print "