Advertisement
alexs77

EW-Mail.FormMail193.patch

Sep 20th, 2012
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.24 KB | None | 0 0
  1. --- EW-Mail.pl  2005-12-21 14:07:22.000000000 +0100
  2. +++ FormMail.pl 2009-07-14 21:47:46.000000000 +0200
  3. @@ -2,5 +2,5 @@
  4.  ##############################################################################
  5. -# FormMail                        Version 1.92                               #
  6. -# Copyright 1995-2002 Matt Wright mattw@scriptarchive.com                    #
  7. -# Created 06/09/95                Last Modified 04/21/02                     #
  8. +# FormMail                        Version 1.93                               #
  9. +# Copyright 1995-2009 Matt Wright mattw@scriptarchive.com                    #
  10. +# Created 1995-06-09              Last Modified 2009-07-14                   #
  11.  # Matt's Script Archive, Inc.:    http://www.scriptarchive.com/              #
  12. @@ -8,3 +8,3 @@
  13.  # COPYRIGHT NOTICE                                                           #
  14. -# Copyright 1995-2002 Matthew M. Wright  All Rights Reserved.                #
  15. +# Copyright 1995-2009 Matthew M. Wright  All Rights Reserved.                #
  16.  #                                                                            #
  17. @@ -23,3 +23,4 @@
  18.  # ACCESS CONTROL FIX: Peter D. Thompson Yezek                                #
  19. -#                     http://www.securityfocus.com/archive/1/62033           #
  20. +# XSS + REDIRECT FIX: Francesco Ongaro, Giovanni Pellerano & Antonio Parata  #
  21. +#   v1.93             http://www.ush.it/team/ush/hack-formmail_192/adv.txt   #
  22.  ##############################################################################
  23. @@ -32,9 +33,9 @@
  24.  
  25. -$mailprog = '/usr/sbin/sendmail -i -t -f xxx';
  26. +$mailprog = '/usr/lib/sendmail -i -t';
  27.  
  28.  # @referers allows forms to be located only on servers which are defined     #
  29. -# in this field.  This security fix from the last version which allowed      #
  30. -# anyone on any server to use your FormMail script on their web site.        #
  31. +# in this field.  This is a security fix to prevent others from using your   #
  32. +# FormMail script on their web site.                                         #
  33.  
  34. -@referers = ('scriptarchive.com','209.196.21.3');
  35. +@referers = ('scriptarchive.com','72.52.156.109');
  36.  
  37. @@ -98,5 +99,2 @@
  38.  
  39. -    $check_referer = 1;
  40. -
  41. -
  42.      # If the HTTP_REFERER was invalid, send back an error.                   #
  43. @@ -231,2 +229,14 @@
  44.  
  45. +    # Fix XSS + HTTP Header Injection for v1.93
  46. +    foreach $lfield ('redirect', 'return_link_url') {
  47. +        # Strip new lines
  48. +        $Config{$lfield} =~ s/(\n|\r)//mg;
  49. +
  50. +        # Only allow certain handlers to avoid javascript:/data: tricks
  51. +        if ($Config{$lfield} !~ /^\s*\// &&
  52. +            $Config{$lfield} !~ /^\s*(http|https|ftp):\/\//) {
  53. +            $Config{$lfield} = '';
  54. +        }
  55. +    }
  56. +
  57.      if (!$Config{'recipient'}) {
  58. @@ -238,9 +248,8 @@
  59.          # a valid domain or e-mail address as defined in @recipients.        #
  60. -        $valid_recipient = 0;
  61.          foreach $send_to (split(/,/,$Config{'recipient'})) {
  62. -           # foreach $recipient (@recipients) {
  63. -           #    if ($send_to =~ /$recipient$/i) {
  64. +            foreach $recipient (@recipients) {
  65. +                if ($send_to =~ /$recipient$/i) {
  66.                      push(@send_to,$send_to); last;
  67. -           #    }
  68. -           # }
  69. +                }
  70. +            }
  71.          }
  72. @@ -380,3 +389,3 @@
  73.          <hr size=1 width=75%><p>
  74. -        <center><font size=-1><a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 &copy; 1995 - 2002  Matt Wright<br>
  75. +        <center><font size=-1><a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
  76.  A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a></font></center>
  77. @@ -396,3 +405,3 @@
  78.      print MAIL "To: $Config{'recipient'}\n";
  79. -    print MAIL "From: $Config{'email'} $Config{'realname'}\n";
  80. +    print MAIL "From: $Config{'email'} ($Config{'realname'})\n";
  81.  
  82. @@ -582,3 +591,3 @@
  83.       <center><font size=-1>
  84. -      <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 &copy; 1995 - 2002  Matt Wright<br>
  85. +      <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
  86.        A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a>
  87. @@ -598,3 +607,3 @@
  88.   <head>
  89. -  <title>FormMail v1.92</title>
  90. +  <title>FormMail v1.93</title>
  91.   </head>
  92. @@ -606,4 +615,4 @@
  93.     <table border=0 width=600 bgcolor=#CFCFCF>
  94. -    <tr><th><tt><font size=+1>Copyright 1995 - 2002 Matt Wright<br>
  95. -        Version 1.92 - Released April 21, 2002<br>
  96. +    <tr><th><tt><font size=+1>Copyright 1995 - 2009 Matt Wright<br>
  97. +        Version 1.93 - Released June 25, 2009<br>
  98.          A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive,
  99. @@ -637,3 +646,3 @@
  100.       <center><font size=-1>
  101. -      <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 &copy; 1995 - 2002  Matt Wright<br>
  102. +      <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
  103.        A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a>
  104. @@ -668,3 +677,3 @@
  105.       <center><font size=-1>
  106. -      <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 &copy; 1995 - 2002  Matt Wright<br>
  107. +      <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
  108.        A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a>
  109. @@ -699,3 +708,3 @@
  110.       <center><font size=-1>
  111. -      <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 &copy; 1995 - 2002  Matt Wright<br>
  112. +      <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
  113.        A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a>
  114. @@ -739,3 +748,3 @@
  115.       <center><font size=-1>
  116. -      <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 &copy; 1995 - 2002  Matt Wright<br>
  117. +      <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
  118.        A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement