# CVE-2021-21239: python3-pysaml2: PySAML2 is a pure python implementation of SAML Version 2 Standard

CVE-2021-21239 is fixed in 2 products on 1 platform, first by python-pysaml2 4.0.2-0ubuntu3.2, released January 21, 2021. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2021-21239
- Priority: Routine
- CVSS: n/a (Medium)
- EPSS: 0.0129
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Jan 21, 2021

## Description

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.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | python-pysaml2 Ubuntu 18.04.6 LTS (bionic) | 4.0.2-0ubuntu3.2 | [python-pysaml2 4.0.2-0ubuntu3.2](https://patchblox.com/security/data/fix/linux/ubuntu-bionic-python-pysaml2-4.0.2-0ubuntu3.2.md) | Jan 21, 2021 |
| Linux | python3-pysaml2 Ubuntu 18.04.6 LTS (bionic) | 4.0.2-0ubuntu3.2 | [python3-pysaml2 4.0.2-0ubuntu3.2](https://patchblox.com/security/data/fix/linux/ubuntu-bionic-python3-pysaml2-4.0.2-0ubuntu3.2.md) | Jan 21, 2021 |
| Linux | python3-pysaml2 Ubuntu 20.04 LTS (focal) | 4.9.0-0ubuntu3.1 | [python3-pysaml2 4.9.0-0ubuntu3.1](https://patchblox.com/security/data/fix/linux/ubuntu-focal-python3-pysaml2-4.9.0-0ubuntu3.1.md) | Jan 21, 2021 |
| Linux | python3-pysaml2 Ubuntu 22.04.1 LTS (jammy) | 6.1.0-0ubuntu2 | [python3-pysaml2 6.1.0-0ubuntu2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-python3-pysaml2-6.1.0-0ubuntu2.md) | Jan 21, 2021 |

---

Data as of 2026-11-09T07:25:28Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
