SAML: CVE-2021-21239

This exercise covers the exploitation of CVE-2021-21239 (PySAML2)

1-2 Hrs.


In this course, you will learn how to exploit a vulnerability in a SAML implementation that affects the Service Provider. The issue arises from the use of the binary xmlsec1 by pysaml2, which trusts an embedded key without verifying it against the certificate configured for the Service Provider. This flaw allows an attacker to generate a signed document and modify a valid SAMLResponse to gain unauthorized access.

The attack involves manipulating the SAMLResponse to bypass the signature verification process. Specifically, xmlsec1 does not check if the embedded key matches the certificate used by the Service Provider, leading to a potential security breach. The course provides practical steps on how to set up xmlsec1, modify the SAMLResponse, and use xmlsec1 to sign it, ultimately demonstrating how such vulnerabilities can be detected and exploited.

Understanding this vulnerability is crucial as more enterprises adopt SSO solutions, making it essential to identify and fix these security flaws before they can be exploited.

Want to learn more? Get started with PentesterLab Pro! GO PRO