Skip to content

Commit a8ee006

Browse files
committed
Fix an un reported issue validating URL with extra parameters
1 parent b096862 commit a8ee006

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/Net/SAML2/Binding/Redirect.pm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,19 @@ sub verify {
180180
my $saml_request;
181181
my $sig = $u->query_param_delete('Signature');
182182

183+
# During the verify the only query parameters that should be in the query are
184+
# 'SAMLRequest', 'RelayState', 'Sig', 'SigAlg' the other parameter values are
185+
# deleted from the URI query that was created from the URL that was passed
186+
# to the verify function
187+
my @signed_params = ('SAMLRequest', 'RelayState', 'Sig', 'SigAlg');
188+
189+
for my $key ($u->query_param) {
190+
if (grep /$key/, @signed_params ) {
191+
next;
192+
}
193+
$u->query_param_delete($key);
194+
}
195+
183196
# Some IdPs (PingIdentity) seem to double encode the LogoutResponse URL
184197
if (defined $self->sls_double_encoded_response and $self->sls_double_encoded_response == 1) {
185198
#if ($sigalg =~ m/%/) {

0 commit comments

Comments
 (0)