GHSA-vq6g-g6c7-5f2j: Medium severity pip/social-auth-core vulnerability
Impact
The SAML backend accepted SAML responses on the Assertion Consumer Service endpoint without verifying that they matched a previously issued AuthnRequest.
Applications using SAML account association could allow an attacker with a valid account on a trusted IdP to link the attacker's SAML identity to a logged-in victim's local account. The attacker could then authenticate through SAML and gain access to the victim's account.
The issue affects applications using the SAML backend together with authenticated account association.
Patches
The issue has been fixed by validating SAML responses against stored AuthnRequest IDs.
Users should upgrade to a patched version.
Fix:
https://github.com/python-social-auth/social-core/pull/1794
Workarounds
Applications that cannot upgrade immediately should disable SAML account association for already authenticated users.
If SAML login is not required, the SAML backend can also be disabled by removing it from SOCIALAUTHAUTHENTICATIONBACKENDS.
There is no complete workaround while continuing to allow vulnerable SAML account association.
Credits
Reported through GitHub private vulnerability reporting by Liyi Zhou, Ziyue Wang, Strick, Maurice, and Chenchen Yu from the University of Sydney security research team.
Reporter references:
https://lzhou1110.github.io/ https://zyy0530.github.io/ https://str1ckl4nd.github.io/ https://maurice.busystar.org/ https://7thparkk.github.io/
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/social-auth-coreto a version that resolves this vulnerability.Fixed in 5.0.0 - Configuration
Disable SAML account association for already authenticated users until the application can be upgraded.
SAML account association SAML account association for already authenticated users = disabled - Configuration
If SAML login is not required, disable the SAML backend by removing it from SOCIAL_AUTH_AUTHENTICATION_BACKENDS.
SAML backend SOCIAL_AUTH_AUTHENTICATION_BACKENDS = SAML backend removed
Event History
Frequently Asked Questions
Which deployments are exposed to account takeover?
Applications using the SAML backend together with authenticated account association are affected. The attack relies on a victim already being logged in to a local account and an attacker having a valid account at a trusted identity provider.
What interaction is required for exploitation?
An attacker needs a valid trusted-IdP account and must cause a SAML response to be accepted at the Assertion Consumer Service endpoint while targeting a logged-in victim's local account. The vulnerable behavior is the lack of validation that the response corresponds to a previously issued AuthnRequest.
What can be done if an upgrade cannot be applied immediately?
Disable SAML account association for already authenticated users. If SAML login is not required, remove the SAML backend from SOCIAL_AUTH_AUTHENTICATION_BACKENDS; there is no complete workaround if vulnerable SAML account association remains enabled.