Signature bypassin IdentityPython pysaml2.
Proof of concept public (GitHub).
PySAML2 is a pure python implementation of SAML Version 2 Standard. PySAML2 before 6.5.0 has an improper verification of cryptographic signature vulnerability. Users of pysaml2 that use the default CryptoBackendXmlSec1 backend and need to verify signed SAML documents are impacted. PySAML2 does not ensure that a signed SAML document is correctly signed. The default CryptoBackendXmlSec1 backend is using the xmlsec1 binary to verify the signature of signed SAML documents, but by default xmlsec1 accepts any type of key found within the given document. xmlsec1 needs to be configured explicitly to only use only _x509 certificates_ for the verification process of the SAML document signature. This is fixed in PySAML2 6.5.0.
- Upgrade pysaml2 to 6.5.0 or later.
- Upgrade pysaml2 (PyPI) to 6.5.0 or later.
Affected and fixed versions
From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.
From first report to first attacks
- 22 Dec 2020CVE ID reserved by GitHub_M.
- 21 Jan 2021Published in the CVE List.
- 18 Jul 2024First public proof of concept on GitHub.
- 3 Aug 2024CVE record last updated.
Attack code anyone can find
Exploit maturity: Proof of concept (GitHub).
Listed so defenders can judge how urgent this is and test systems they are authorised to test. Patchminder does not host exploit code; links open the source page. Labels for GitHub repositories come from their public details and are never a promise about the code. Run anything only in an isolated lab.
Report a link
Other pysaml2 vulnerabilities
Same weakness: Improper verification of cryptographic signature
- github.com x_refsource_CONFIRM
- pypi.org x_refsource_MISC
- www.aleksey.com x_refsource_MISC
- github.com x_refsource_MISC
- github.com x_refsource_MISC
- lists.debian.org mailing-list, x_refsource_MLIST
Patchminder. CVE-2021-21239: Signature bypass in IdentityPython pysaml2. https://patchminder.com/cve/cve-2021-21239/ (accessed 5 December 2026).