CVE-2021-21239
Open default xmlsec1 key-type preference
Check your servers for CVE-2021-21239
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-21239 affects pysaml2, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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. 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.
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- required: a user has to do something, such as open a link or a file
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality none, integrity high, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 1.29%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 71.0% of all scored CVEs. Scores of 1 Dec 2026.
Weakness
- CWE-347 Improper Verification of Cryptographic Signature
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| pysaml2 |
affected < 6.5.0
|
Is my server affected?
Find the installed version of pysaml2 and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i pysaml2
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2021-21239 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2021-21239RHEL, Rocky, Alma, Fedora
rpm -q pysaml2
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-21239Alpine
apk list --installed | grep -i pysaml2With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2021-21239
trivy image --scanners vuln IMAGE | grep CVE-2021-21239
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
Other references
- https://pypi.org/project/pysaml2 pypi.org
- https://www.aleksey.com/pipermail/xmlsec/2013/009717.html aleksey.com
- https://github.com/IdentityPython/pysaml2/releases/tag/v6.5.0 github.com
- https://github.com/IdentityPython/pysaml2/commit/46578df0695269a16f1c94171f1429873f90ed99 github.com
- [debian-lts-announce] 20210226 [SECURITY] [DLA 2577-1] python-pysaml2 security update lists.debian.org · mailing list
Source: the record CVE-2021-21239 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse