patchminder
Proof of concept · GitHub CVE-2021-21239

Signature bypassin IdentityPython pysaml2.

Published 21 Jan 2021 · Updated 3 Aug 2024 · Every fact sourced

JSONCite
Is it exploited?
Not confirmed

Proof of concept public (GitHub).

Attack code is public
Severity
Medium 6.5
CVSSA severity score from 0 to 10. 9 and higher is critical. 3.1 · no login needed
Attack likelihood
Moderate
EPSSA daily score from FIRST: the chance a hole is attacked in the next 30 days. 1.3% chance in 30 days · 4 Dec 2026
Fix
Available
Upgrade to 6.5.0 or later
In plain words

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.

What to do now
  • Upgrade pysaml2 to 6.5.0 or later.
  • Upgrade pysaml2 (PyPI) to 6.5.0 or later.
Versions

Affected and fixed versions

Product or package
Affected
Fixed in
Source
pysaml2
before 6.5.0
6.5.0
CVE record
pysaml2 (PyPI)
before 6.5.0
6.5.0
GitHub advisory

From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.

Timeline

From first report to first attacks

  1. 22 Dec 2020
    CVE ID reserved by GitHub_M.
  2. 21 Jan 2021
    Published in the CVE List.
  3. 18 Jul 2024
    First public proof of concept on GitHub.
  4. 3 Aug 2024
    CVE record last updated.
Exploit code

Attack code anyone can find

Exploit maturity: Proof of concept (GitHub).

Metasploit module
None known
Nuclei scan template
None known
Exploit-DB
None known
GitHub proof of concepts
4 repositories
GitHubno warning signs foundRyanBoomer30/CVE-2021-21239-Exploit0 stars · created 18 Jul 2024Report documentation of this script is below
GitHubno warning signs foundGrantBirki/redash-vulnerable0 stars · created 3 Aug 2025A Dockerized Redash instance that is vulnerable to CVE-2021-21239
GitHubno warning signs foundillera88/CVE-2021-212390 stars · created 10 Sep 2025
GitHubno warning signs foundCrims-on/CVE-2021-212390 stars · created 26 Feb 2026A script to exploit a vulnerability in xmlsec1 where xmlsec ignores loaded public keys

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.

Related

Other pysaml2 vulnerabilities

Same weakness: Improper verification of cryptographic signature

All CWE-347 vulnerabilities

References
Cite this page

Patchminder. CVE-2021-21239: Signature bypass in IdentityPython pysaml2. https://patchminder.com/cve/cve-2021-21239/ (accessed 5 December 2026).