GHSA-p9w9-87c8-m235 Admidio Sends SAML Response to Unvalidated Assertion Consumer Service URL from AuthnRequest
SummaryThe SAML IdP implementation in Admidio's SSO module uses the `AssertionConsumerServiceURL` value directly from incoming SAML AuthnRequest messages as the destination for the SAML response, without validating it against the registered ACS URL (`smc_acs_url`) stored in the database for the corresponding service provider client. An attacker who knows the Entity ID of a registered SP client can craft a SAML AuthnRequest with an arbitrary `AssertionConsumerServiceURL`, causing the IdP to send the signed SAML response -- containing user identity attributes (login name, email, roles, profile fields) -- to an attacker-controlled URL.DetailsThe vulnerability is in `src/SSO/Service/SAMLService.php`, in `handleSSORequest()` at lines 439-465:There is no code that compares `$clientACS` against the client's registered `smc_acs_url` column value. The SAML 2.0 specification and OASIS security considerations explicitly require IdPs to verify that the AssertionConsumerServiceURL matches one of the SP's registered ACS endpoints.**Signature validation is conditional and does not prevent this attack:**At lines 417-419:If neither `smc_require_auth_signed` nor `smc_validate_signatures` is enabled for the SP client (which is the default when creating a new client), the AuthnRequest is processed without any signature verification. This means an attacker only needs to know the SP's Entity ID (which is often publicly discoverable from the SP's metadata endpoint) to craft a malicious AuthnRequest.Even when signatures ARE validated, the ACS URL should still be checked against the registered value, because:Signature validation proves the request came from the SP, not that the ACS URL is authorizedIf the SP's signing key is compromised, the ACS URL becomes the last line of defenseThis follows the defense-in-depth principle mandated by SAML 2.0 Profiles Section 4.1.4.1**The same pattern exists in the error response path** at lines 323-326:**Attack flow:**Attacker discovers the Entity ID of a SAML client registered in Admidio (e.g., from the SP's public metadata)Attacker crafts a SAML AuthnRequest with the legitimate Entity ID but an attacker-controlled `AssertionConsumerServiceURL`Attacker sends this AuthnRequest to Admidio's SSO endpoint (via redirect or auto-submitting form)If the user is already logged in to Admidio, the IdP generates a signed SAML response with the user's identity and attributesThe SAML response is POST-binding-sent to the attacker's URL via an auto-submitting HTML form rendered in the victim's browserThe attacker receives the signed SAML assertion containing login name, email, full name, roles, and other profile fieldsThe attacker can replay this SAML assertion to the legitimate SP (since it is validly signed by the IdP)PoCImpact**User Identity Theft**: The signed SAML assertion containing login credentials, email, name, and roles is sent to an attacker-controlled URL. The attacker can replay this assertion to the legitimate SP to impersonate the victim.**Information Disclosure**: User profile data (email, phone, address, role memberships, and any custom profile fields configured in the SP's field mapping) is exfiltrated.**Scope Change (S:C)**: The IdP vulnerability directly enables impersonation on separate Service Provider applications.**No Signature Required**: When `smc_require_auth_signed` is not enabled (default), the attack requires zero knowledge of cryptographic keys -- only the SP's Entity ID.Recommended FixValidate the `AssertionConsumerServiceURL` from the AuthnRequest against the registered `smc_acs_url` before using it. In `src/SSO/Service/SAMLService.php`, add validation after loading the client:Also apply the same validation in the `errorResponse()` method at line 323-326:
CVSS v3.1 score: 8.2