enapps-enorman opened a new pull request #4:
URL: https://github.com/apache/sling-org-apache-sling-auth-form/pull/4


   Sonar reports a potential security vulnerability related to the usage of the 
client supplied cookie domain value to clear out the old formauth cookies 
during logout.  The sonar suggestion is to change this code to not echo this 
user-controlled data in the response header.
    
   I propose these changes to FormAuthenticationHandler.CookieStorage:
   
   1. In CookieStorage#set validate that the supplied (or configured) cookie 
domain value is valid for the request host.  If the value is invalid, then log 
a warning and send the cookie without any domain value.   Previously, the 
cookies are sent with an invalid domain and that results in login just silently 
not working.  The fallback of sending no domain should make the login work and 
the log file would have the reason why no domain was sent.
   2. In CookieStorage#clear validate that the client supplied cookie domain 
value is valid for the request host.  If the value is invalid, than log a 
warning and attempt to clear the cookies using the configured default cookie 
domain (if any).  Logout may still not work if the default cookie domain isn't 
right, but the log file would have the reason instead of silently not working.
    


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to