# CVE-2021-21239: Open default xmlsec1 key-type preference

- Severity: Medium 6.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.29%, higher than 71% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-01-21T14:12:18.000Z
- Modified: 2026-09-10T03:49:13.846Z
- Also known as: GHSA-5p3x-r448-pc62, PYSEC-2021-49
- Weaknesses: CWE-347
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- IdentityPython pysaml2: < 6.5.0
- pysaml2 (PyPI): before 6.5.0; before 46578df0695269a16f1c94171f1429873f90ed99
- pysaml2_project pysaml2: before 6.5.0
- debian debian_linux: 9.0

## Every score

- GitHub_M: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`
- GitHub: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:P/A:N`

## References

- <https://www.aleksey.com/pipermail/xmlsec/2013/009717.html> (exploit, mailing-list, third-party-advisory, web)
- <https://github.com/IdentityPython/pysaml2/security/advisories/GHSA-5p3x-r448-pc62> (advisory, third-party-advisory, web)
- <https://pypi.org/project/pysaml2> (package, product, third-party-advisory, web)
- <https://github.com/IdentityPython/pysaml2/releases/tag/v6.5.0> (third-party-advisory, web)
- <https://github.com/IdentityPython/pysaml2/commit/46578df0695269a16f1c94171f1429873f90ed99> (fix, patch, third-party-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2021/02/msg00038.html> (mailing-list, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-21239> (advisory)
- <https://github.com/IdentityPython/pysaml2> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/pysaml2/PYSEC-2021-49.yaml> (web)

## Sources

- CVE List: [CVE-2021-21239](https://www.cve.org/CVERecord?id=CVE-2021-21239), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-5p3x-r448-pc62](https://github.com/advisories/GHSA-5p3x-r448-pc62), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2021-21239](https://nvd.nist.gov/vuln/detail/CVE-2021-21239), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2021-49](https://osv.dev/vulnerability/PYSEC-2021-49), CC-BY-4.0, modified 2023-11-08

---

Page: https://cve.day/CVE-2021-21239 · Whole record: https://cve.day/CVE-2021-21239.json · Rebuilt by cve.day 2026-11-25T22:57:59.716Z
