github SAML-Toolkits/php-saml 2.24.0
OneLogin's SAML PHP Toolkit v2.24.0

54 minutes ago
  • Fix #674 Escape the values written in the XML of the AuthnRequest, LogoutRequest, LogoutResponse and the SP metadata. A value with a &, like an IdP URL with several query parameters, produced an XML that was not well formed:
    • AuthnRequest: Destination (idp.singleSignOnService.url), ProviderName (displayname of the organization), sp.NameIDFormat, the security.requestedAuthnContext values, security.requestedAuthnContextComparison and the NameID of the Subject (nameIdValueReq)
    • LogoutRequest: Destination (idp.singleLogoutService.url) and SessionIndex
    • LogoutResponse: Destination (idp.singleLogoutService.responseUrl) and InResponseTo
    • Metadata: the organization and contact person data, sp.NameIDFormat, the bindings, and the name, description, requested attributes and attribute values of sp.attributeConsumingService
      The URL the user is redirected to is not changed. If any of those settings was defined already escaped (&) to get a valid XML, the escaping must be removed from the settings, otherwise the value will be escaped twice
  • Fix #657 The Destination check of OneLogin_Saml2_Response, OneLogin_Saml2_LogoutRequest and OneLogin_Saml2_LogoutResponse is done by the new OneLogin_Saml2_Utils::checkDestination, so the 3 messages are validated in the same way:
    • security.requireDestination now also applies to OneLogin_Saml2_LogoutRequest and OneLogin_Saml2_LogoutResponse: when true, a logout message with no Destination attribute is rejected with OneLogin_Saml2_ValidationError::MISSING_DESTINATION
    • The Destination of a OneLogin_Saml2_LogoutRequest and a OneLogin_Saml2_LogoutResponse is trimmed before it is compared, as the one of the OneLogin_Saml2_Response already was. A Destination that only has whitespaces is now reported as OneLogin_Saml2_ValidationError::EMPTY_DESTINATION instead of WRONG_DESTINATION, and security.relaxDestinationValidation accepts it
  • Update certificate and private_key string replacement to include tabs.
  • Add OneLogin_Saml2_IdPMetadataParser::getLastFetchedXMLFromUrl, which returns the XML that the last call to OneLogin_Saml2_IdPMetadataParser::parseRemoteXML retrieved from the URL (null if the request failed)
  • Several decryption error handling improvements:
    • A rsa-1_5 key transport rejected by the security.allowRSA15KeyTransport setting is reported with the new OneLogin_Saml2_ValidationError::ENCRYPTION_ALGORITHM_NOT_ALLOWED code and a message that names the setting that allows the algorithm (OneLogin_Saml2_Utils::RSA15_KEY_TRANSPORT_NOT_ALLOWED_MESSAGE). Before, it was a KEY_ALGORITHM_ERROR with the "Unsupported or not allowed key transport algorithm" message, which is kept for the algorithms that are not supported
    • An EncryptedAssertion that can not be decrypted no longer makes the OneLogin_Saml2_Response constructor throw: isValid() returns false and getErrorException() has the cause.
      This covers a rejected algorithm and every other decryption error of the EncryptedAssertion and of the EncryptedID inside it (OneLogin_Saml2_Error::PRIVATE_KEY_NOT_FOUND, OneLogin_Saml2_ValidationError::DECRYPTION_FAILED, KEY_ALGORITHM_ERROR, MISSING_ENCRYPTED_ELEMENT, KEYINFO_NOT_FOUND_IN_ENCRYPTED_DATA...). The assertion of such a Response is not available (encrypted is false), as when the signature of the message is rejected before decrypting it.
    • OneLogin_Saml2_Utils::decryptElement, OneLogin_Saml2_Utils::validateEncryptedDataStructure, OneLogin_Saml2_Response::getNameIdData/getNameId and OneLogin_Saml2_LogoutRequest::getNameIdData/getNameId throw the error with the new code for a rejected rsa-1_5 key transport. Other errors are thrown as before
    • OneLogin_Saml2_LogoutRequest::isValid() (and so OneLogin_Saml2_Auth::processSLO, with the invalid_logout_request error) already reported a rejected algorithm in the EncryptedID; its error now has the new code
  • OneLogin_Saml2_Response::isValid() decrypts the EncryptedID of a not encrypted Assertion once the signatures are validated, as OneLogin_Saml2_LogoutRequest::isValid() does, so a NameID that can not be decrypted makes isValid() return false. Before, isValid() returned true and getNameId() threw later

Don't miss a new php-saml release

NewReleases is sending notifications on new releases.