{"id":"CVE-2021-21239","aliases":["CVE-2021-21239","GHSA-5p3x-r448-pc62","PYSEC-2021-49"],"related":[],"kind":"vulnerability","state":"published","title":"Open default xmlsec1 key-type preference","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nAll 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.\n\n### Patches\n\nUsers should upgrade to pysaml2 `v6.5.0`.\n\n### Workarounds\n\nNo workaround provided at this point.\n\n### References\n\nThis issue has been reported in the past at the xmlsec1 mailing list:\nhttps://www.aleksey.com/pipermail/xmlsec/2013/009717.html\n\n### Credits\n\n- Brian Wolff\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [pysaml2](https://github.com/IdentityPython/pysaml2)\n* Email us at [the incident-response address](mailto:incident-response@idpy.org)","format":"markdown","source":"ghsa"},{"lang":"es","text":"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","source":"nvd"}],"published":"2021-01-21T14:12:18.000Z","modified":"2026-09-10T03:49:13.846Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-347"],"affected":[{"ranges":[{"version":"< 6.5.0","status":"affected"}],"vendor":"IdentityPython","product":"pysaml2","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.5.0"}],"ecosystem":"PyPI","package":"pysaml2","purl":"pkg:pypi/pysaml2","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"6.5.0"}],"vendor":"pysaml2_project","product":"pysaml2","cpe":"cpe:2.3:a:pysaml2_project:pysaml2:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"9.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"46578df0695269a16f1c94171f1429873f90ed99"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.5.0"}],"ecosystem":"PyPI","package":"pysaml2","purl":"pkg:pypi/pysaml2","repo":"https://github.com/IdentityPython/pysaml2","source":"pysec"}],"references":[{"url":"https://github.com/IdentityPython/pysaml2/security/advisories/GHSA-5p3x-r448-pc62","tags":["advisory","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://pypi.org/project/pysaml2","tags":["package","product","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.aleksey.com/pipermail/xmlsec/2013/009717.html","tags":["exploit","mailing-list","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/IdentityPython/pysaml2/releases/tag/v6.5.0","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/IdentityPython/pysaml2/commit/46578df0695269a16f1c94171f1429873f90ed99","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/02/msg00038.html","tags":["mailing-list","third-party-advisory","web","x-refsource-mlist","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21239","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/IdentityPython/pysaml2","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/pysaml2/PYSEC-2021-49.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-21239","url":"https://www.cve.org/CVERecord?id=CVE-2021-21239","licence":"CVE Terms of Use","modified":"2024-08-03T18:09:14.896Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5p3x-r448-pc62","url":"https://github.com/advisories/GHSA-5p3x-r448-pc62","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:13.846Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-21239","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21239","licence":"Public domain","modified":"2026-06-17T03:35:06.293Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-49","url":"https://osv.dev/vulnerability/PYSEC-2021-49","licence":"CC-BY-4.0","modified":"2023-11-08T04:04:39.128Z"}],"updatedAt":"2026-11-25T22:57:59.716Z","epss":{"score":0.01291,"percentile":0.7109,"date":"2026-12-01T12:00:22.000Z"}}