Changeset 7310


Ignore:
Timestamp:
05/02/10 07:19:36 (2 years ago)
Author:
CrawfordCurrie
Message:

Item1945: change CSRF confirmation 302 to an absolute URL and incorporate Babar's explanation for 419. Thx to MartinVonGagern and OlivierRaginel.

Location:
trunk/core/lib/Foswiki
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/lib/Foswiki/UI.pm

    r7173 r7310  
    319319        print STDERR "ValidationException: redirect with $uid\n"; 
    320320 
    321         # We use the login script for 
    322         # validation because it already has the correct criteria 
    323         # in httpd.conf for Apache login. 
     321        # We use the login script for validation because it already 
     322        # has the correct criteria in httpd.conf for Apache login. 
     323        # URL is absolute as required by 
     324        # http://tools.ietf.org/html/rfc2616#section-14.30 
    324325        my $url = $session->getScriptUrl( 
    325             0, 'login', 
     326            1, 'login', 
    326327            $session->{webName}, $session->{topicName}, 
    327328            foswikiloginaction => 'validate', 
  • trunk/core/lib/Foswiki/Validation.pm

    r6895 r7310  
    281281          ."\n" if TRACE; 
    282282 
    283         # prompt for user verification - code 419 chosen by foswiki devs 
     283        # Prompt for user verification - code 419 chosen by foswiki devs. 
     284        # None of the defined HTTP codes describe what is really happening, 
     285        # which is why we chose a "new" code. The confirmation page 
     286        # isn't a conflict, not a security issue, and we cannot use 403 
     287        # because there is a high probability this would get caught by 
     288        # Apache to send back the Registation page. We didn't want any 
     289        # installation to catch the HTTP return code we were sending back, 
     290        # as we need this page to arrive intact to the user, otherwise 
     291        # they won't be able to do anything. 419 is a placebo, and if it 
     292        # is ever defined can be replaced by any other undefined 4xx code. 
    284293        $session->{response}->status(419); 
    285294 
Note: See TracChangeset for help on using the changeset viewer.