/[smeserver]/rpms/e-smith-manager/sme9/e-smith-manager-2.6.0-bz9920.badredirection.patch
ViewVC logotype

Contents of /rpms/e-smith-manager/sme9/e-smith-manager-2.6.0-bz9920.badredirection.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Thu Jan 19 21:55:33 2017 UTC (7 years, 3 months ago) by unnilennium
Branch: MAIN
CVS Tags: e-smith-manager-2_6_0-15_el6_sme, e-smith-manager-2_6_0-23_el6_sme, e-smith-manager-2_6_0-22_el6_sme, e-smith-manager-2_6_0-21_el6_sme, e-smith-manager-2_6_0-24_el6_sme, e-smith-manager-2_6_0-17_el6_sme, e-smith-manager-2_6_0-14_el6_sme, e-smith-manager-2_6_0-20_el6_sme, e-smith-manager-2_6_0-25_el6_sme, e-smith-manager-2_6_0-16_el6_sme, e-smith-manager-2_6_0-19_el6_sme, e-smith-manager-2_6_0-18_el6_sme, HEAD
Changes since 1.1: +28 -9 lines
* Thu Jan 19 2017 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-14.sme
- move fix to the right line to be effective [SME: 9920]

1 diff -Nur e-smith-manager-2.6.0.old/root/etc/e-smith/web/common/cgi-bin/login e-smith-manager-2.6.0/root/etc/e-smith/web/common/cgi-bin/login
2 --- e-smith-manager-2.6.0.old/root/etc/e-smith/web/common/cgi-bin/login 2017-01-19 16:44:33.747000000 -0500
3 +++ e-smith-manager-2.6.0/root/etc/e-smith/web/common/cgi-bin/login 2017-01-19 16:53:20.795000000 -0500
4 @@ -129,6 +129,13 @@
5 my $ip_addr = $at->ignore_ip ? undef : $ENV{REMOTE_ADDR};
6 my $redirected = 0;
7
8 +my $b = URI->new($back);
9 +# If $back domain doesn't match $AUTH_DOMAIN, stop there do not give opportunity to log in
10 +my $domain = $AUTH_DOMAIN || $server_name;
11 +if ($b->host !~ m/\b$domain$/i) {
12 + $fatal="Bad redirection parameter: \"$back\" is not an authorized redirection.<br />\nYou may be experiencing an attack.<br />\nLogin is not possible on the above URL for your own security.<br />\nPlease manually enter the address you were trying to reach if you followed a link.";
13 + }
14 +
15 # ------------------------------------------------------------------------
16 # Set the auth cookie and redirect to $back
17 my $set_cookie_redirect = sub {
18 @@ -156,14 +163,6 @@
19 print $q->header( -cookie => $cookie );
20 #return 0 if $debug;
21
22 - my $b = URI->new($back);
23 - # If $back domain doesn't match $AUTH_DOMAIN, pass ticket via back GET param
24 - my $domain = $AUTH_DOMAIN || $server_name;
25 - if ($b->host !~ m/\b$domain$/i) {
26 - $back .= $b->query ? '&' : '?';
27 - $back .= $at->cookie_name . '=' . $tkt;
28 - }
29 -
30 # For some reason, using a Location: header doesn't seem to then see the
31 # cookie, but a meta refresh one does - weird
32 print $q->start_html(

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed