6.5medium
SAML XML Signature wrapping
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.10% (higher than 66% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-f4g9-h89h-jgv9PYSEC-2021-48
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. All users of pysaml2 that need to validate signed SAML documents are impacted. The vulnerability is a variant of XML Signature wrapping because it did not validate the SAML document against an XML schema. This allowed invalid XML documents to be processed and such a document can trick pysaml2 with a wrapped 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 1d8fd268f5bf887480a403a7a5ef8f048157cc14 | GitHub Advisory Database, PyPA Advisory Database |
| pysaml2_project pysaml2 | before 6.5.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 |
| 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. All users of pysaml2 that need to validate signed SAML documents are impacted. The vulnerability is a variant of XML Signature wrapping because it did not validate the SAML document against an XML schema. This allowed invalid XML documents to be processed and such a document can trick pysaml2 with a wrapped 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 validate the SAML document against an XML schema. This allows invalid XML documents to trick the verification process, by presenting elements with a valid signature inside elements whose content has been malformed. The verification is offloaded to xmlsec1 and xmlsec1 will not validate every signature in the given document, but only the first it finds in the given scope.
Patches
Users should upgrade to pysaml2 v6.5.0.
Workarounds
No workaround provided at this point.
References
No references provided at this point.
Credits
- Victor Schönfelder Garcia (isits AG International School of IT Security)
- Juraj Somorovsky (Paderborn University)
- Vladislav Mladenov (Ruhr University Bochum)
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. Todos los usuarios de pysaml2 que necesitan comprobar documentos SAML firmados están afectados. La vulnerabilidad es una variante del empaquetado de firma XML porque no validó el documento SAML con un esquema XML. Esto permitió que documentos XML sean procesados no válidos y dicho documento puede engañar a pysaml2 con una firma empaquetada. Esto es corregido en PySAML2 versión 6.5.0
References
| 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/security/advisories/GHSA-f4g9-h89h-jgv9 | advisory, third-party-advisory, web | |
| https://github.com/IdentityPython/pysaml2/commit/1d8fd268f5bf887480a403a7a5ef8f048157cc14 | fix, patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-21238 | advisory | |
| https://github.com/IdentityPython/pysaml2 | package | |
| https://github.com/pypa/advisory-database/tree/main/vulns/pysaml2/PYSEC-2021-48.yaml | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-21238 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-f4g9-h89h-jgv9 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2021-21238 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2021-48 changed 2023-11-08 | CC-BY-4.0 |