# CVE-2021-21238: SAML XML Signature wrapping

- Severity: Medium 6.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.10%, higher than 66% of CVEs (2026-12-01)
- Published: 2021-01-21T14:12:16.000Z
- Modified: 2026-09-10T03:49:13.856Z
- Also known as: GHSA-f4g9-h89h-jgv9, PYSEC-2021-48
- Weaknesses: CWE-347
- Assigned by: GitHub_M

## 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. 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.

(As written by CVE List.)

## Affected

- IdentityPython pysaml2: < 6.5.0
- pysaml2 (PyPI): before 6.5.0; before 1d8fd268f5bf887480a403a7a5ef8f048157cc14
- pysaml2_project pysaml2: before 6.5.0

## Every score

- GitHub_M: 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`
- GitHub: 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`
- NVD: 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`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:P/A:N`

## References

- <https://pypi.org/project/pysaml2> (package, product, third-party-advisory, web)
- <https://github.com/IdentityPython/pysaml2/releases/tag/v6.5.0> (third-party-advisory, web)
- <https://github.com/IdentityPython/pysaml2/security/advisories/GHSA-f4g9-h89h-jgv9> (advisory, third-party-advisory, web)
- <https://github.com/IdentityPython/pysaml2/commit/1d8fd268f5bf887480a403a7a5ef8f048157cc14> (fix, patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-21238> (advisory)
- <https://github.com/IdentityPython/pysaml2> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/pysaml2/PYSEC-2021-48.yaml> (web)

## Sources

- CVE List: [CVE-2021-21238](https://www.cve.org/CVERecord?id=CVE-2021-21238), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-f4g9-h89h-jgv9](https://github.com/advisories/GHSA-f4g9-h89h-jgv9), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2021-21238](https://nvd.nist.gov/vuln/detail/CVE-2021-21238), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2021-48](https://osv.dev/vulnerability/PYSEC-2021-48), CC-BY-4.0, modified 2023-11-08

---

Page: https://cve.day/CVE-2021-21238 · Whole record: https://cve.day/CVE-2021-21238.json · Rebuilt by cve.day 2026-11-25T22:57:59.715Z
