CVE-2021-21239 | Open default xmlsec1 key-type preference

Exp

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.

Published: 2021-01-21 Last update: 2026-06-17 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2021-21239 is rated High Exploit Risk (63.7/100): CVSS Medium severity, with medium exploitation likelihood (EPSS 1.18%). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Public exploit references (Exploit-DB) for CVE-2021-21239

EDB-ID Source Kind Published Link
nvd_ref exploit_tag Exploit-DB ↗

Exploit prediction scoring system (EPSS) score for CVE-2021-21239

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-06-15 0.68% 1.18% +0.50%
2 2026-05-16 3.10% 0.68% -2.42%
3 2026-04-22 3.10%

Full EPSS history (51 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2021-21239

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
6.5 3.1 MEDIUM
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:N)
Service keeps running; no real outage angle.
2.8 3.6 [email protected]
6.5 3.1 MEDIUM
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:N)
Service keeps running; no real outage angle.
2.8 3.6 [email protected]
4.3 2.0 MEDIUM
AV:N/AC:M/Au:N/C:N/I:P/A:N Click to expand
Access vector (AV:N)
Can be exploited remotely over network reachability.
Access complexity (AC:M)
Exploitation needs some favorable conditions, but not exceptional ones.
Authentication (AU:N)
No authentication is required.
Confidentiality impact (C:N)
No confidentiality impact.
Integrity impact (I:P)
Partial integrity impact.
Availability impact (A:N)
No availability impact.
8.6 2.9 [email protected]

Weakness enumeration for CVE-2021-21239

GitHub Security Advisory for CVE-2021-21239

GHSA-5p3x-r448-pc62 · Severity: medium · Ecosystem: pip — Improper Verification of Cryptographic Signature in PySAML2

OS Trackers for CVE-2021-21239

vendor priority summary link
alpine medium CVE-2021-21239: 1 source package rows (py3-saml2); 7 state rows across 7 repos (3.17-community, 3.18-community, 3.19-community, 3.20-community, 3.21-community, 3.22-community, edge-community); fixed 7, open 0. https://security.alpinelinux.org/vuln/CVE-2021-21239
debian not yet assigned CVE-2021-21239 not yet assigned priority: Debian including 1 source packages (python-pysaml2), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2021-21239
redhat medium https://access.redhat.com/security/cve/CVE-2021-21239
suse medium CVE-2021-21239 severity moderate: SUSE including 137 source package names (ardana-cobbler-8.0+git.1614096566.e8c2b27-3.44.3, ardana-neutron-9.0+git.1615223676.777f0b3-3.25.2, …), 256 product×package rows across 6 product lines (HPE Helion OpenStack 8, SUSE OpenStack Cloud 8, … (6 product lines)): Fixed 256. https://www.suse.com/security/cve/CVE-2021-21239/
ubuntu medium CVE-2021-21239 medium priority: Ubuntu including 1 source packages (python-pysaml2), 9 status rows across 9 suites (bionic, focal, groovy, hirsute, impish, jammy, trusty, upstream, xenial): released 7, DNE 1, ignored 1. https://ubuntu.com/security/CVE-2021-21239

Affected software / configurations for CVE-2021-21239

Vendor Product Version Raw CPE
pysaml2_project pysaml2 < 6.5.0 cpe:2.3:a:pysaml2_project:pysaml2:*:*:*:*:*:*:*:*
debian debian_linux 9.0 cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*

References for CVE-2021-21239

cvelogic Threat Intelligence