Summary
CoreWCF's SAML token validation previously failed to enforce SubjectConfirmation method URIs and holder-of-key proof keys, weakening its authentication guarantees.
Under these conditions, a subject could be authenticated without proving control of the referenced key or assertion, enabling holder-of-key downgrades and unauthorized access in SAML-secured services.
Affected context
This vulnerability affects applications using CoreWCF with SAML-based authentication and relying on SamlSecurityTokenHandler for token validation.
It is relevant in environments where services accept SAML assertions for client or user identity and expect strict enforcement of SubjectConfirmation methods (such as holder-of-key) and associated proof keys.
The risk materializes when SAML tokens can be introduced or manipulated by parties who can craft assertions with custom or weakened confirmation methods that are still accepted as valid by the service.
Exploit preconditions
- Attack surface: SAML-secured CoreWCF service endpoints that validate tokens via SamlSecurityTokenHandler.
- Required access: Ability to submit or influence SAML tokens presented to the service (e.g., via a federated identity provider, token issuance flow, or upstream integration).
- Trigger point: Token validation stage where SubjectConfirmation elements are evaluated, but confirmation method URIs and holder-of-key proof keys are not strictly enforced.
- Why exploitation is possible: The validator accepts assertions as authenticated subjects even when the SubjectConfirmation method is downgraded or uses custom methods, and does not require proof of possession for holder-of-key scenarios, undermining the intended trust model.
Why this happens
The core issue lies in incomplete enforcement of SAML SubjectConfirmation semantics during token validation.
In a secure holder-of-key design, a token's subject must demonstrate possession of the key referenced in the assertion; however, SamlSecurityTokenHandler in the affected CoreWCF versions allowed tokens to be treated as authenticated without verifying that proof-of-possession.
Likewise, it did not strictly validate the SubjectConfirmation method URIs, permitting custom or downgraded methods that bypass expected checks.
This maps to CWE-287: Improper Authentication and CWE-345: Insufficient Verification of Data Authenticity, where identity claims are accepted without enforcing the necessary cryptographic or semantic guarantees.
Potential impact
- An attacker may authenticate as a legitimate subject without proving control of the corresponding key material.
- Services could grant unauthorized access to operations or data protected by SAML-based authentication.
- Existing authorization policies may be undermined due to incorrectly trusted SAML assertions.
- Attackers could pivot within a distributed system by presenting crafted tokens to multiple SAML-relying services.
General mitigation guidance
Mitigation focuses on strengthening token validation logic and enforcing SAML confirmation semantics consistently across services.
Recommended patterns include:
- Ensuring that SubjectConfirmation method URIs are strictly validated against an allowlist of supported and secure methods (e.g., holder-of-key, bearer where appropriate).
- Requiring proof-of-possession for holder-of-key tokens by binding the assertion to a cryptographic key and verifying that the client demonstrates control of that key during the protocol exchange.
- Treating custom or unexpected SubjectConfirmation methods as invalid and rejecting the associated assertions.
- Implementing centralized authentication policies that codify how SAML tokens must be validated, including confirmation rules and cryptographic requirements, and applying those policies consistently to all CoreWCF endpoints.
- Designing services with least-privilege authorization so that even if a token is improperly accepted, the blast radius of any unauthorized identity is minimized.
How teams detect issues like this
Detection typically relies on reviewing both configuration and code paths that handle SAML token validation.
Useful strategies include:
- Static analysis rules or manual code review to identify usages of SamlSecurityTokenHandler and confirm that SubjectConfirmation methods and proof keys are explicitly validated.
- Security-focused review of authentication middleware and CoreWCF service configuration to ensure that holder-of-key semantics are enforced and that only approved SubjectConfirmation methods are accepted.
- Audit logging of SAML authentication events, including the SubjectConfirmation method and key identifiers, followed by anomaly detection for unexpected or custom methods.
- Policy enforcement in CI/CD pipelines that flag changes to token validation logic, requiring security sign-off when SAML handling components are modified.

