Skip to content

Commit

Permalink
escape some params
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Jun 12, 2017
1 parent f670603 commit c2d4a90
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions acl/save_user.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ else {

# Validate username, and check for a clash
$in{'name'} =~ /^[A-z0-9\-\_\.\@]+$/ && $in{'name'} !~ /^\@/ ||
&error(&text('save_ename', $in{'name'}));
&error(&text('save_ename', &html_escape($in{'name'})));
$in{'name'} eq 'webmin' && &error($text{'save_enamewebmin'});
if (!$in{'old'} || $in{'old'} ne $in{'name'}) {
my $clash = &get_user($in{'name'});
$clash && &error(&text('save_edup', $in{'name'}));
$clash && &error(&text('save_edup', &html_escape($in{'name'})));
}
!$access{'logouttime'} || $in{'logouttime_def'} ||
$in{'logouttime'} =~ /^\d+$/ || &error($text{'save_elogouttime'});
Expand Down
3 changes: 2 additions & 1 deletion software/file_info.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ else {
}

if (!%file) {
print "<b>",&text('file_notfound', "<tt>$f</tt>"),"</b><p>\n";
print "<b>",&text('file_notfound',
"<tt>".&html_escape($f)."</tt>"),"</b><p>\n";
}
else {
# display file info
Expand Down
3 changes: 2 additions & 1 deletion software/search.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ if (@match == 1 && $in{'goto'}) {
if (@match) {
@match = sort { lc($packages{$a,'name'}) cmp lc($packages{$b,'name'}) }
@match;
print "<b>",&text('search_match', "<tt>$s</tt>"),"</b><p>\n";
print "<b>",&text('search_match',
"<tt>".&html_escape($s)."</tt>"),"</b><p>\n";
print &ui_form_start("delete_packs.cgi", "post");
print &ui_hidden("search", $in{'search'});
@tds = ( "width=5" );
Expand Down
3 changes: 2 additions & 1 deletion webmin/change_referers.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ require './webmin-lib.pl';
$gconfig{'referer'} = $in{'referer'};
@refs = split(/\s+/, $in{'referers'});
foreach my $r (@refs) {
$r =~ /^[a-z0-9\.\-\_]+$/ || &error(&text('referers_ehost', $r));
$r =~ /^[a-z0-9\.\-\_]+$/ ||
&error(&text('referers_ehost', &html_escape($r)));
}
$gconfig{'referers'} = join(" ", @refs);
$gconfig{'referers_none'} = int(!$in{'referers_none'});
Expand Down

0 comments on commit c2d4a90

Please sign in to comment.