don't redirect to a GET with sensitive data, RT#26099
authorIvan Kohler <ivan@freeside.biz>
Mon, 18 Nov 2013 01:10:49 +0000 (17:10 -0800)
committerIvan Kohler <ivan@freeside.biz>
Mon, 18 Nov 2013 01:10:49 +0000 (17:10 -0800)
httemplate/elements/handle_uri_query

index eb7ea1a..2dea96a 100644 (file)
@@ -1,8 +1,20 @@
 <%init>
+
+my %opt = @_;
+
 if ( $cgi->param('redirect') ) {
   my $session = $cgi->param('redirect');
+
   my $pref = $FS::CurrentUser::CurrentUser->option("redirect$session");
   die "unknown redirect session $session\n" unless length($pref);
   $cgi = new CGI($pref);
+
+  foreach my $param (grep /pay(info\d?|cvv)$/, $cgi->param) {
+    my $value = $cgi->param($param);
+    next unless length($value);
+    my $decrypted = FS::Record->decrypt( $value );
+    $cgi->param($param, $decrypted);
+  }
+
 }
 </%init>