cve.bz

CVE-2021-21239

6.5 mediumExploit referenceEPSS 1.3%Fix available

Medium (6.5). EPSS 1.3% estimated probability of exploitation activity in the next 30 days. Fixed in pysaml2 6.5.0.

On this page
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 3.1

6.5 medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
EPSS
1.3% (unchanged from 1.3% a week ago; 1.3% 30 days ago) estimated probability of exploitation activity in the next 30 days; 71st percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-347 Improper Verification of Cryptographic Signature
OWASP Top 10
A04:2025 Cryptographic Failures
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-21239 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-21239?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-21239?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-21239 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
pysaml2_project:pysaml2before 6.5.0
debian:debian_linux9.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-5p3x-r448-pc62PyPIpysaml2<6.5.06.5.0
PYSEC-2021-49PyPIpysaml2<6.5.06.5.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9python-pysaml23.0.0-5+deb9u2DLA-2577-1
Debian12, 13, 14python-pysaml26.5.1-1DEBIAN-CVE-2021-21239
Ubuntu18.04:LTSpython-pysaml24.0.2-0ubuntu3.2UBUNTU-CVE-2021-21239 USN-5066-1
Ubuntu20.04:LTSpython-pysaml24.9.0-0ubuntu3.1UBUNTU-CVE-2021-21239 USN-5066-1
Ubuntu22.04:LTSpython-pysaml26.1.0-0ubuntu2UBUNTU-CVE-2021-21239
UbuntuPro:16.04:LTSpython-pysaml23.0.0-3ubuntu1.16.04.4+esm1UBUNTU-CVE-2021-21239 USN-5066-2
SUSEHPE Helion OpenStack 8documentation-hpe-helion-openstack-user, documentation-hpe-helion-openstack-planning, documentation-hpe-helion-openstack-security and 3 more8.20210512-1.32.5SUSE-SU-2021:2554-1
SUSEHPE Helion OpenStack 8venv-openstack-horizon-hpe12.0.5~dev6-14.36.3SUSE-SU-2021:2554-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8ardana-cobbler8.0+git.1614096566.e8c2b27-3.44.3SUSE-SU-2021:2554-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-aodh5.1.1~dev7-12.32.3SUSE-SU-2021:2554-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-barbican5.0.2~dev3-12.33.3SUSE-SU-2021:2554-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-ceilometer9.0.8~dev7-12.30.3SUSE-SU-2021:2554-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-cinder11.2.3~dev29-14.34.2SUSE-SU-2021:2554-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-designate5.0.3~dev7-12.31.3SUSE-SU-2021:2554-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-freezer5.0.0.0~xrc2~dev2-10.28.3SUSE-SU-2021:2554-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-glance15.0.3~dev3-12.31.3SUSE-SU-2021:2554-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-heat9.0.8~dev22-12.33.2SUSE-SU-2021:2554-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-ironic9.1.8~dev8-12.33.3SUSE-SU-2021:2554-1
64 more for SUSE in the JSON and on SUSE's page.
openSUSETumbleweedpython-pysaml27.4.2-1.2openSUSE-SU-2024:14156-1
openSUSETumbleweedpython-pysaml27.5.4-1.1openSUSE-SU-2026:11524-1
Alpinev3.13py3-saml26.4.1-r1ALPINE-CVE-2021-21239
Alpinev3.14, v3.15, v3.16 and 8 morepy3-saml26.5.0-r0ALPINE-CVE-2021-21239

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

All versions of Red Hat OpenStack Platform ship but do not use the flawed check-signature functionality of python-pysaml2. The impact for these products is therefore rated as having a security impact of Low and will not be updated at this time.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat OpenStack Platform 10 (Newton)python-pysaml2Out of support scope
Red Hat OpenStack Platform 13 (Queens)python-pysaml2Out of support scope
Red Hat OpenStack Platform 16.1python-pysaml2Will not fix
Red Hat OpenStack Platform 16.2python-pysaml2Will not fix

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-21239.

GitHub PoC

Repositories on GitHub named after this CVE or listed for it by the PoC-in-GitHub index. For those marked Harbor Check: matches CVE, Flawharbor read the code and found it implements this CVE's exploitation technique: read, not run, and its dependencies only checked for warning signs, so a pointer and no guarantee. The rest are unverified: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it. How Harbor Check reads them, and what it found.

  • Crims-on/CVE-2021-21239 Harbor Check: matches CVE 0 stars, Python, created
    A script to exploit a vulnerability in xmlsec1 where xmlsec ignores loaded public keys

Attack patterns (CAPEC)

  • CAPEC-463 Padding Oracle Crypto Attack Severity: High
  • CAPEC-475 Signature Spoofing by Improper Validation Likelihood: Low · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON