6.5medium
Open default xmlsec1 key-type preference
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.29% (higher than 71% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-5p3x-r448-pc62PYSEC-2021-49
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| IdentityPython pysaml2 | < 6.5.0 | CVE List |
| pysaml2 (PyPI) | before 6.5.0, before 46578df0695269a16f1c94171f1429873f90ed99 | GitHub Advisory Database, PyPA Advisory Database |
| pysaml2_project pysaml2 | before 6.5.0 | NVD |
| debian debian_linux | 9.0 | NVD |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
| GitHub | medium CVSS:4.0 | 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 | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
Impact
All users of pysaml2 that use the default CryptoBackendXmlSec1 backend and need to verify signed SAML documents are impacted. pysaml2 <= 6.4.1 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.
Patches
Users should upgrade to pysaml2 v6.5.0.
Workarounds
No workaround provided at this point.
References
This issue has been reported in the past at the xmlsec1 mailing list: https://www.aleksey.com/pipermail/xmlsec/2013/009717.html
Credits
- Brian Wolff
For more information
If you have any questions or comments about this advisory:
- Open an issue in pysaml2
- Email us at the incident-response address
NVD (es)
PySAML2 es una implementación de Python pura de SAML Versión 2 Estándar. PySAML2 versiones anteriores a 6.5.0, presenta una verificación inapropiada de una vulnerabilidad de firma criptográfica. Los usuarios de pysaml2 que utilizan el backend CryptoBackendXmlSec1 predeterminado y necesitan verificar los documentos SAML firmados están afectados. PySAML2 no garantiza que un documento SAML firmado esté correctamente firmado. El backend CryptoBackendXmlSec1 predeterminado está usando el binario xmlsec1 para verificar la firma de los documentos SAML firmados, pero por defecto xmlsec1 acepta cualquier tipo de clave que se encuentre dentro del documento dado. xmlsec1 debe configurarse explícitamente para usar solo _x509 certificates_ para el proceso de verificación de la firma del documento SAML. Esto es corregido en PySAML2 versión 6.5.0
References
| 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://www.aleksey.com/pipermail/xmlsec/2013/009717.html | exploit, mailing-list, 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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-21239 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-5p3x-r448-pc62 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2021-21239 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2021-49 changed 2023-11-08 | CC-BY-4.0 |