CVE-2021-21238 | SAML XML Signature wrapping

PySAML2 is a pure python implementation of SAML Version 2 Standard. PySAML2 before 6.5.0 has an improper verification of cryptographic signature vulnerability. All users of pysaml2 that need to validate signed SAML documents are impacted. The vulnerability is a variant of XML Signature wrapping because it did not validate the SAML document against an XML schema. This allowed invalid XML documents to be processed and such a document can trick pysaml2 with a wrapped signature. This is fixed in PySAML2 6.5.0.

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

Conclusion & alert: CVE-2021-21238 is rated Moderate Risk (48.1/100): CVSS Medium severity, with medium exploitation likelihood (EPSS 1.08%). Mandatory action: Review affected assets and schedule remediation.

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

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

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.14% 1.08% +0.94%
2 2025-11-21 0.16% 0.14% -0.02%
3 2025-11-18 0.16%

Full EPSS history (10 records total)

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

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-21238

GitHub Security Advisory for CVE-2021-21238

GHSA-f4g9-h89h-jgv9 · Severity: medium · Ecosystem: pip — SAML XML Signature wrapping in PySAML2

OS Trackers for CVE-2021-21238

vendor priority summary link
alpine medium CVE-2021-21238: 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-21238
debian not yet assigned CVE-2021-21238 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-21238
redhat medium https://access.redhat.com/security/cve/CVE-2021-21238
suse medium CVE-2021-21238 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-21238/
ubuntu low CVE-2021-21238 low priority: Ubuntu including 1 source packages (python-pysaml2), 16 status rows across 16 suites (bionic, focal, groovy, hirsute, impish, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): not-affected 6, ignored 4, needed 4, DNE 1, released 1. https://ubuntu.com/security/CVE-2021-21238

Affected software / configurations for CVE-2021-21238

Vendor Product Version Raw CPE
pysaml2_project pysaml2 < 6.5.0 cpe:2.3:a:pysaml2_project:pysaml2:*:*:*:*:*:*:*:*

References for CVE-2021-21238

cvelogic Threat Intelligence