CVE-2021-21239Open default xmlsec1 key-type preference
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.
What to do
Fixed builds are available from Alpine, Debian, PyPI, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 22.04 | python-pysaml2 | Fixed | 6.1.0-0ubuntu2 | UBUNTU-CVE-2021-21239 |
| Ubuntu 20.04 | python-pysaml2 | Fixed | 4.9.0-0ubuntu3.1 | UBUNTU-CVE-2021-21239 |
| Ubuntu 18.04 | python-pysaml2 | Fixed | 4.0.2-0ubuntu3.2 | UBUNTU-CVE-2021-21239 |
| Ubuntu 16.04 | python-pysaml2 | Fix pending | 3.0.0-3ubuntu1.16.04.4+esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-21239 |
| Debian 14 | python-pysaml2 | Fixed | 6.5.1-1 | DEBIAN-CVE-2021-21239 |
| Debian 13 | python-pysaml2 | Fixed | 6.5.1-1 | DEBIAN-CVE-2021-21239 |
| Debian 12 | python-pysaml2 | Fixed | 6.5.1-1 | DEBIAN-CVE-2021-21239 |
| Alpine Linux 3.24 | py3-saml2 | Fixed | 6.5.0-r0 | ALPINE-CVE-2021-21239 |
| Alpine Linux 3.23 | py3-saml2 | Fixed | 6.5.0-r0 | ALPINE-CVE-2021-21239 |
| Alpine Linux 3.22 | py3-saml2 | Fixed | 6.5.0-r0 | ALPINE-CVE-2021-21239 |
| Alpine Linux 3.21 | py3-saml2 | Fixed | 6.5.0-r0 | ALPINE-CVE-2021-21239 |
| Alpine Linux 3.20 | py3-saml2 | Fixed | 6.5.0-r0 | ALPINE-CVE-2021-21239 |
| Alpine Linux 3.19 | py3-saml2 | Fixed | 6.5.0-r0 | ALPINE-CVE-2021-21239 |
| Alpine Linux 3.18 | py3-saml2 | Fixed | 6.5.0-r0 | ALPINE-CVE-2021-21239 |
| Alpine Linux 3.17 | py3-saml2 | Fixed | 6.5.0-r0 | ALPINE-CVE-2021-21239 |
| Alpine Linux 3.16 | py3-saml2 | Fixed | 6.5.0-r0 | ALPINE-CVE-2021-21239 |
| Alpine Linux 3.15 | py3-saml2 | Fixed | 6.5.0-r0 | ALPINE-CVE-2021-21239 |
| Alpine Linux 3.14 | py3-saml2 | Fixed | 6.5.0-r0 | ALPINE-CVE-2021-21239 |
| Alpine Linux 3.13 | py3-saml2 | Fixed | 6.4.1-r1 | ALPINE-CVE-2021-21239 |
| PyPI library | pysaml2 | Fixed | 6.5.0 | GHSA-5p3x-r448-pc62 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- IdentityPython pysaml2: affected: < 6.5.0
References
- https://github.com/IdentityPython/pysaml2/security/advisories/GHSA-5p3x-r448-pc62
- https://pypi.org/project/pysaml2
- https://www.aleksey.com/pipermail/xmlsec/2013/009717.html
- https://github.com/IdentityPython/pysaml2/releases/tag/v6.5.0
- https://github.com/IdentityPython/pysaml2/commit/46578df0695269a16f1c94171f1429873f90ed99
- https://lists.debian.org/debian-lts-announce/2021/02/msg00038.html
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.