CVE-2025-24894
Summary
SPID.AspNetCore.Authentication is an AspNetCore Remote Authenticator for SPID. Authentication using Spid and CIE is based on the SAML2 standard which provides two entities: Identity Provider (IDP): the system that authenticates users and provides identity information (SAML affirmation) to the Service Provider, in essence, is responsible for the management of the credentials and identity of users; Service Provider (SP): the system that provides a service to the user and relies on the Identity Provider to authenticate the user, receives SAML assertions from the IdP to grant access to resources. The validation logic of the signature is central as it ensures that you cannot create a SAML response with arbitrary assertions and then impersonate other users. There is no guarantee that the first signature refers to the root object, it follows that if an attacker injects an item signed as the first element, all other signatures will not be verified. The only requirement is to have an XML element legitimately signed by the IdP, a condition that is easily met using the IdP’s public metadata. An attacker could create an arbitrary SAML response that would be accepted by SPs using vulnerable SDKs, allowing him to impersonate any Spid and/or CIE user. This vulnerability has been addressed in version 3.4.0 and all users are advised to upgrade. There are no known workarounds for this vulnerability.
Severity
- Base Score: 9.1
- Exploitability Score: 3.9
- Impact Score: 5.2
- Exploitable: 0
Details
CVE-2025-24894 describes a critical vulnerability in SPID.AspNetCore.Authentication related to SAML signature validation. The vulnerability stems from the fact that the signature validation process doesn’t ensure that the first signature verified refers to the root XML object of the SAML response. This allows an attacker to inject a signed XML element as the first element in the response. Consequently, subsequent signatures are not properly verified. The only requirement is to have a legitimate XML element signed by the Identity Provider (IdP), which can be obtained from the IdP’s public metadata. By exploiting this flaw, an attacker can forge arbitrary SAML responses, effectively impersonating any SPID or CIE user and gaining unauthorized access to services protected by the vulnerable SP.
Remediation
The primary and recommended remediation strategy is to upgrade SPID.AspNetCore.Authentication to version 3.4.0 or later. This version contains a fix that addresses the flawed signature validation logic, preventing attackers from injecting arbitrary SAML responses.
Since there are no known workarounds, upgrading is essential.
Steps to Remediate:
- Identify affected applications: Determine which applications are using the vulnerable version of SPID.AspNetCore.Authentication.
- Upgrade the package: Use your package manager (e.g., NuGet) to upgrade the SPID.AspNetCore.Authentication package to version 3.4.0 or later in each affected application. dotnet add package SPID.AspNetCore.Authentication –version 3.4.0 3. Test the applications: Thoroughly test the affected applications after the upgrade to ensure that authentication is working correctly and that the vulnerability has been mitigated. Pay specific attention to SAML authentication flows.
- Monitor: Continue monitoring the SPID.AspNetCore.Authentication project for any further security updates or recommendations.
Assigner
- Name: GitHub, Inc.
- Email: [email protected]
Date
- Published Date: 2025-02-18 18:39:37
- Updated Date: 2025-02-18 19:15:28