CVE-2021-21238
JSON

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 packageVersionsReported by
IdentityPython pysaml2< 6.5.0CVE List
pysaml2 (PyPI)before 6.5.0, before 1d8fd268f5bf887480a403a7a5ef8f048157cc14GitHub Advisory Database, PyPA Advisory Database
pysaml2_project pysaml2before 6.5.0NVD

All scores

GitHub_M6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
GitHub6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
NVD4.3medium CVSS:2.0AV: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:

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

Sources

SourceRecordLicence
CVE ListCVE-2021-21238 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-f4g9-h89h-jgv9 changed 2026-09-10CC-BY-4.0
NVDCVE-2021-21238 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2021-48 changed 2023-11-08CC-BY-4.0