source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* cvsweb: more XSS prevention; patch from afresh1@; also triggered by the
@ 2019-03-21 23:08 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-03-21 23:08 UTC (permalink / raw)
  To: source

Log Message:
-----------
more XSS prevention; patch from afresh1@;
also triggered by the report from Ezio Paglia

Tags:
----
FreeBSD-cvsweb-2_0-branch

Modified Files:
--------------
    cvsweb:
        cvsweb.cgi

Revision Data
-------------
Index: cvsweb.cgi
===================================================================
RCS file: /home/cvs/mandoc/cvsweb/cvsweb.cgi,v
retrieving revision 3.119.2.15
retrieving revision 3.119.2.16
diff -Lcvsweb.cgi -Lcvsweb.cgi -u -p -r3.119.2.15 -r3.119.2.16
--- cvsweb.cgi
+++ cvsweb.cgi
@@ -2842,7 +2842,7 @@ sub doLog($) {
 	print $sel;
 	print "</select>\n";
 	$diffrev = $revdisplayorder[$#revdisplayorder];
-	$diffrev = $input{"r1"} if (defined($input{"r1"}));
+	$diffrev = htmlquote($input{"r1"}) if (defined($input{"r1"}));
 	print
 	    "<input type=\"text\" size=\"$inputTextSize\" name=\"tr1\" value=\"$diffrev\" onchange=\"this.form.r1.selectedIndex=0\"></td>\n";
 	print "<td><br></td>\n</tr>\n";
@@ -2853,7 +2853,7 @@ sub doLog($) {
 	print $sel;
 	print "</select>\n";
 	$diffrev = $revdisplayorder[0];
-	$diffrev = $input{"r2"} if (defined($input{"r2"}));
+	$diffrev = htmlquote($input{"r2"}) if (defined($input{"r2"}));
 	print
 	    "<input type=\"text\" size=\"$inputTextSize\" name=\"tr2\" value=\"$diffrev\" onchange=\"this.form.r2.selectedIndex=0\"></td>\n";
 	print "<td><input type=\"submit\" value=\"  Get Diffs  \" accesskey=\"G\"></td>\n";
@@ -2898,7 +2898,8 @@ sub doLog($) {
 		next if ($_ eq "f");
 		next if ($_ eq "only_with_tag");
 		next if ($_ eq "logsort");
-		print "<input type=\"hidden\" name=\"$_\" value=\"$input{$_}\">\n"
+		printf "<input type=\"hidden\" name=\"%s\" value=\"%s\">\n",
+		    $_, htmlquote($input{$_})
 		    if (defined($input{$_})
 		    && (!defined($DEFAULTVALUE{$_})
 		    || $input{$_} ne $DEFAULTVALUE{$_}) && $input{$_} ne "");
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-21 23:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 23:08 cvsweb: more XSS prevention; patch from afresh1@; also triggered by the schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).