Skip to content

Commit

Permalink
Item13897: Validate the defaultweb parameter.
Browse files Browse the repository at this point in the history
Don't accept it unvalidated / untainted.
  • Loading branch information
gac410 committed Oct 30, 2016
1 parent 0069647 commit f023a40
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions core/lib/Foswiki/Request.pm
Expand Up @@ -1250,9 +1250,15 @@ sub _establishParamList {

sub _establishWeb {
my $this = shift;
return ( $this->_pathParsed->{web}
|| $this->param('defaultweb')
|| $this->app->cfg->data->{UsersWebName} );

if ( $this->_pathParsed->{web} ) {
return $this->_pathParsed->{web};
}
elsif ( $this->param('defaultweb') ) {
return Foswiki::Sandbox::untaint( $this->param('defaultweb'),
\&Foswiki::Sandbox::validateWebName );
}
return $this->app->cfg->data->{UsersWebName};
}

sub _establishTopic {
Expand Down

0 comments on commit f023a40

Please sign in to comment.