Skip to content
Snippets Groups Projects
  1. May 31, 2018
  2. Apr 13, 2018
  3. Feb 02, 2018
  4. Jan 26, 2018
  5. Jan 04, 2018
  6. Nov 29, 2017
  7. Oct 19, 2017
  8. Jun 06, 2017
    • Jaime Pérez Crespo's avatar
      Fix a bug in the PHP session handler · ab344d88
      Jaime Pérez Crespo authored
      When unserializing the session fails, the handler should return null instead of false. Additionally, SimpleSAML_Session::load() should make sure that it got an instance of SimpleSAML_Session, to avoid any misbehaving handlers to generate an issue.
      
      This resolves #616.
      ab344d88
  9. Apr 01, 2017
  10. Mar 17, 2017
  11. Dec 05, 2016
  12. Jul 28, 2016
    • Jaime Pérez's avatar
      Use AttributeValue serializable objects instead of dumping manually the XML contents. · 6d215c0b
      Jaime Pérez authored
      This way, we avoid completely any possible XXE attack, and simplify the code as we don't need to deal directly with the DOM. The entire AttributeValue will be saved to the backend as XML, and then recovered back when unserializing.
      6d215c0b
    • Jaime Pérez's avatar
      bugfix: Allow attributes to contain raw XML as their values. · 977b8e86
      Jaime Pérez authored
      A recent change in simplesamlphp/saml2#60 made the library return a DOMNodeList object when the contents of the AttributeValue element are not text. This lead to a bug, since the returned value is not serializable, and when storing it in the session it will go away as soon as we serialize the session to store it in the backend (whatever that is). This is always, as the SP will always redirect to the URL originating authentication. The result was an empty DOMNodeList object where there should be some value.
      
      This commit makes the SimpleSAML_Session to implement the Serializable interface. When obtaining the attributes during login (doLogin() method), the code will now look for DOMNodeList objects, and dump them as a string with the XML representation of their contents in the 'RawAttributes' array inside $this->authData[$authority]. This allows us to parse the XML back when unserializing, and restore the original DOMNodeList object as the value of the attribute.
      
      The issue was reported originally in the mailing list by Enrico Cavalli, affecting eduPersonTargetedID. This resolves #424.
      977b8e86
  13. Jul 07, 2016
  14. Jul 04, 2016
    • Jaime Pérez's avatar
      bugfix: Make sure SimpleSAML_Session::getSessionFromRequest() always raises an... · 52c6bf04
      Jaime Pérez authored
      bugfix: Make sure SimpleSAML_Session::getSessionFromRequest() always raises an exception when a transient session is used due to a misconfiguration or a temporary failure fetching an existing session.
      
      Transient sessions are just an exceptional event, and they shouldn't be treated as regular sessions. Therefore, if we are trying to get the current session and end up with a transient one, that's because an error occurred and we should raise an exception. Since exceptions due to secure cookies trying to be set via an insecure channel are likely to be misconfigurations, we treat them like that, raising a SimpleSAML\Error\CriticalConfigurationError.
      
      Additionally, we capture exceptions in the SimpleSAML\Logger::flush() method, ensuring the error reported in #413 doesn't happen again.
      
      This resolves #356.
      52c6bf04
    • Jaime Pérez's avatar
    • Jaime Pérez's avatar
      Capture errors when setting the auth token cookie. · 84d9aacc
      Jaime Pérez authored
      If it fails for some reason, we clear all the authentication-related data from the session, log an error, and throw again the exception, so that the user does not continue as if anything happened when the auth token is not set.
      84d9aacc
    • Jaime Pérez's avatar
      bugfix: Do not set the auth token with the setCookie() method from the session handler. · bcd0ae9b
      Jaime Pérez authored
      Related to previous commits. The SimpleSAML_Session::updateSessionCookies() updates both the session cookie and the auth token. For the latter, it uses the setCookie() method from the session handler, while it should use the SimpleSAML\Utils\HTTP::setCookie() method instead.
      bcd0ae9b
  15. Jul 02, 2016
    • Jaime Pérez's avatar
      bugfix: Stop SimpleSAML_SessionHandler::newSessionId() from initializing the session. · 4056af12
      Jaime Pérez authored
      Historically, SimpleSAML_SessionHandler::newSessionId() has also created the session, sending the cookies to the browser. This is problematic both because given the name of the method one would not assume such behaviour, and also because even for transient sessions the handler would then try to set cookies. When we are using a transient session, it is likely to be because we cannot set cookies or because there was a temporary error when loading the session. If we try to set the cookies even for transient sessions, we could either get an error because cookies cannot be set, or overwrite the previous session cookies with transient ones, trashing a legitimate session in case a temporary error occurs.
      
      As a side effect, this can also cause behaviours like the one described in issue #413. There's no point in trying to set the cookies when it's not possible, so we shouldn't even try, and save us the errors.
      
      To fix this, we made SimpleSAML_SessionHandler::setCookie() abstract, forcing each extending class to implement it. The former implementation is moved to SimpleSAML_SessionHandlerCookie, and the SimpleSAML_SessionHandlerPHP gets a new method that starts the session, effectively sending the cookie. SimpleSAML_Session would then be responsible to call the setCookie() method of the session handler when creating a regular session, and skip it when creating a transient one. This introduces a bug, since SimpleSAML_Session was trying to set the auth token cookie calling the same setCookie() method in the session handler. We fixed that by using SimpleSAML\Utils\HTTP::setCookie() instead, in 8756835b.
      
      This resolves #413.
      4056af12
    • Jaime Pérez's avatar
      Remove superfluous code. · 5a1edb83
      Jaime Pérez authored
      If we just called isset() on SimpleSAML_Session::$instance, and it returned false as we continued execution, it makes no sense to get the "previous" instance since it will always be null. We can just check that $instance is not null later.
      5a1edb83
    • Jaime Pérez's avatar
      Add an optional parameter to SimpleSAML_Session::useTransientSession(). · 067398e8
      Jaime Pérez authored
      This way we can pass an exception that made us use transient sessions, and get the method to throw that exception after getting the transient session.
      067398e8
    • Jaime Pérez's avatar
      SimpleSAML_Session should set the auth token using the... · 8756835b
      Jaime Pérez authored
      SimpleSAML_Session should set the auth token using the SimpleSAML\Utils\HTTP::setCookie(), instead of the setCookie() method provided by session handlers.
      
      The SimpleSAML_SessionHandler::setCookie() method should be used only to set the session cookie, not random cookies. If we want cookies to have the same parameters as session cookies, we can always get the session parameters calling SimpleSAML_SessionHandler::getSessionParams() and pass them to SimpleSAML\Utils\HTTP::setCookie().
      8756835b
  16. Apr 07, 2016
    • Jaime Perez Crespo's avatar
      Add a method to SimpleSAMLphp_SessionHandlerPHP to restore a session existing... · 8dc545b8
      Jaime Perez Crespo authored
      Add a method to SimpleSAMLphp_SessionHandlerPHP to restore a session existing previously to our own session. This can be used in SimpleSAML_Session to restore the PHP session status previous to calling our API, while also guaranteeing that our session is correctly saved. The documentation has been updated to reflect this and recommend how to deal with conflicting PHP sessions. This closes #244 and resolves #349.
      8dc545b8
  17. Mar 31, 2016
  18. Mar 09, 2016
  19. Oct 27, 2015
    • Jaime Perez Crespo's avatar
      Prevent the SimpleSAML_Logger class from creating loops while trying to get... · 3466f176
      Jaime Perez Crespo authored
      Prevent the SimpleSAML_Logger class from creating loops while trying to get the track ID from the session. It must now be set manually by calling SimpleSAML_Logger::setTrackID(). Also allow SimpleSAML_Memcache to differentiate between a key not found in memcache and a request to memcache failed. If all servers are down, an exception is thrown and the user informed about the internal error. This hopefully resolves #264.
      3466f176
  20. Oct 21, 2015
  21. Oct 14, 2015
  22. Aug 05, 2015
  23. Apr 20, 2015
  24. Apr 16, 2015
  25. Jan 20, 2015
Loading