- Fix #674 Escape the values written in the XML of the
AuthnRequest,LogoutRequest,LogoutResponseand 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, thesecurity.requestedAuthnContextvalues,security.requestedAuthnContextComparisonand the NameID of the Subject (nameIdValueReq)LogoutRequest: Destination (idp.singleLogoutService.url) and SessionIndexLogoutResponse: 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 ofsp.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_LogoutRequestandOneLogin_Saml2_LogoutResponseis done by the newOneLogin_Saml2_Utils::checkDestination, so the 3 messages are validated in the same way:security.requireDestinationnow also applies toOneLogin_Saml2_LogoutRequestandOneLogin_Saml2_LogoutResponse: when true, a logout message with no Destination attribute is rejected withOneLogin_Saml2_ValidationError::MISSING_DESTINATION- The Destination of a
OneLogin_Saml2_LogoutRequestand aOneLogin_Saml2_LogoutResponseis trimmed before it is compared, as the one of theOneLogin_Saml2_Responsealready was. A Destination that only has whitespaces is now reported asOneLogin_Saml2_ValidationError::EMPTY_DESTINATIONinstead ofWRONG_DESTINATION, andsecurity.relaxDestinationValidationaccepts it
- Update certificate and private_key string replacement to include tabs.
- Add
OneLogin_Saml2_IdPMetadataParser::getLastFetchedXMLFromUrl, which returns the XML that the last call toOneLogin_Saml2_IdPMetadataParser::parseRemoteXMLretrieved from the URL (null if the request failed) - Several decryption error handling improvements:
- A rsa-1_5 key transport rejected by the
security.allowRSA15KeyTransportsetting is reported with the newOneLogin_Saml2_ValidationError::ENCRYPTION_ALGORITHM_NOT_ALLOWEDcode and a message that names the setting that allows the algorithm (OneLogin_Saml2_Utils::RSA15_KEY_TRANSPORT_NOT_ALLOWED_MESSAGE). Before, it was aKEY_ALGORITHM_ERRORwith 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_Responseconstructor throw:isValid()returns false andgetErrorException()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 (encryptedis 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/getNameIdandOneLogin_Saml2_LogoutRequest::getNameIdData/getNameIdthrow the error with the new code for a rejected rsa-1_5 key transport. Other errors are thrown as beforeOneLogin_Saml2_LogoutRequest::isValid()(and soOneLogin_Saml2_Auth::processSLO, with theinvalid_logout_requesterror) already reported a rejected algorithm in the EncryptedID; its error now has the new code
- A rsa-1_5 key transport rejected by the
OneLogin_Saml2_Response::isValid()decrypts the EncryptedID of a not encrypted Assertion once the signatures are validated, asOneLogin_Saml2_LogoutRequest::isValid()does, so a NameID that can not be decrypted makesisValid()return false. Before,isValid()returned true andgetNameId()threw later