CVE-2021-21239 json
Open default xmlsec1 key-type preference
published 2021-01-21 5 y ago modified 2026-09-10 1 mo ago also GHSA-5p3x-r448-pc62 , PYSEC-2021-49 , EUVD-2021-0211
- cvss
- 6.5
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.3%
- EPSS 1.3% chance of exploitation in 30 days, percentile 70%
- public exploits
- 0
- none known
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.
Patch / fix
- pypi pysaml2 6.5.0
- pysaml2_project pysaml2 6.5.0
- python-pysaml2 Debian 14, Debian 13, Debian 12 6.5.1-1
debian advisories DEBIAN-CVE-2021-21239
- python-pysaml2 Ubuntu 18.04 LTS 4.0.2-0ubuntu3.2
- python-pysaml2 Ubuntu 20.04 LTS 4.9.0-0ubuntu3.1
- python-pysaml2 Ubuntu 22.04 LTS 6.1.0-0ubuntu2
- python-pysaml2 Ubuntu Pro 16.04 LTS 3.0.0-3ubuntu1.16.04.4+esm1
ubuntu advisories UBUNTU-CVE-2021-21239
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kibana OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 4.6.6-3.9.2
- grafana OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 6.7.4-4.18.2
- cassandra OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 3.11.10-5.3.5
- python-py OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 1.4.34-3.3.3
- crowbar-core OpenStack Cloud Crowbar 8 5.0+git.1622489449.a8e60e238-3.50.4
- python-Django OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 1.11.29-3.25.3
- ardana-cobbler OpenStack Cloud 8, HPE Helion OpenStack 8 8.0+git.1614096566.e8c2b27-3.44.3
- openstack-nova OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 16.1.9~dev92-3.48.5
suse advisories SUSE-SU-2021:2554-1SUSE-SU-2021:1962-1
- python-pysaml2 openSUSE Tumbleweed 7.5.4-1.1
- python-pysaml2 openSUSE Tumbleweed 7.4.2-1.2
opensuse advisories openSUSE-SU-2026:11524-1openSUSE-SU-2024:14156-1
- py3-saml2 Alpine 3.13 6.4.1-r1
- py3-saml2 Alpine 3.24, Alpine 3.23, Alpine 3.22 +8 more 6.5.0-r0
alpine advisories ALPINE-CVE-2021-21239
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- python-pysaml2 Arch Linux 6.5.1-1
arch linux advisories AVG-1487
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-21239 updated cvss 6.5
python-pysaml2: An improper verification of cryptographic signature
-
Red Hat OpenStack Platform 10 (Newton) python-pysaml2 Red Hat OpenStack Platform 13 (Queens) python-pysaml2affected: workaround, no fix planned “Out of support scope”
-
Red Hat OpenStack Platform 16.1 python3-pysaml2 Red Hat OpenStack Platform 16.2 python3-pysaml2affected: workaround, no fix planned “Will not fix”
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
1.29% chance of exploitation in the next 30 days, higher than 70% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- aleksey.com https://www.aleksey.com/pipermail/xmlsec/2013/009717.html referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
| NVD | 3.1 | 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
| NVD | 2.0 | 4.3 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
| GitHub | 3.1 | 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | pysaml2 | <6.5.0 |
6.5.0 |
Affected products
- IdentityPython pysaml2
Classification
- Weakness
-
- CWE-347 Improper Verification of Cryptographic Signature
References
-
github.com
/IdentityPython/pysaml2/commit/46578df0695269a16f1c94171f1429873f90ed99
web, patch, third-party-advisory
-
aleksey.com
/pipermail/xmlsec/2013/009717.html
web, exploit, mailing-list, third-party-advisory
-
github.com
/IdentityPython/pysaml2/security/advisories/GHSA-5p3x-r448-pc62
web, third-party-advisory, advisory
-
pypi.org
/project/pysaml2
web, product, third-party-advisory, package
-
github.com
/IdentityPython/pysaml2/releases/tag/v6.5.0
web, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2021/02/msg00038.html
mailing-list, web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-21239
advisory
-
github.com
/IdentityPython/pysaml2
package
-
github.com
/pypa/advisory-database/tree/main/vulns/pysaml2/PYSEC-2021-49.yaml
web
Sources
- CVE List CVE-2021-21239
- GitHub Advisory GHSA-5p3x-r448-pc62
- NVD CVE-2021-21239
- OSV PYSEC-2021-49
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.