Medium

Improper Verification of Cryptographic Signature in PySAML2

  • Disclosed: 21.01.2021
  • Updated: 11.10.2026 15:17

Impact

All users of pysaml2 that use the default CryptoBackendXmlSec1 backend and need to verify signed SAML documents are impacted. pysaml2 <= 6.4.1 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.

Patches

Users should upgrade to pysaml2 v6.5.0.

Workarounds

No workaround provided at this point.

References

This issue has been reported in the past at the xmlsec1 mailing list: https://www.aleksey.com/pipermail/xmlsec/2013/009717.html

Credits

  • Brian Wolff

For more information

If you have any questions or comments about this advisory:

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) pysaml2 < 6.5.0 6.5.0

References

CVSS score 6.5/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
Weakness (CWE)
CWE-347
Platform
Python (PyPI)
Package
pysaml2
Disclosed
21.01.2021
Updated
11.10.2026 15:17

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2021-49 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-5p3x-r448-pc62 - CC BY 4.0

Vulnerability history: pysaml2

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
7
First → latest
03.2017 01.2021
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 2
  • High 2
  • Medium 3

Disclosures per year

  1. 2017: 3
  2. 2018: 1
  3. 2019: 0
  4. 2020: 1
  5. 2021: 2
  6. 2022: 0
  7. 2023: 0
  8. 2024: 0
  9. 2025: 0
  10. 2026: 0
  1. Improper Verification of Cryptographic Signature in PySAML2 this entry
    Medium · 6.5 CVE-2021-21239 < 6.5.0 6.5.0
  2. Medium · 6.5 CVE-2021-21238 < 6.5.0 6.5.0
  3. High · 7.5 CVE-2020-5390 < 5.0.0 5.0.0
  4. Critical · 8.1 CVE-2017-1000433 < 4.5.0 4.5.0
  5. Medium · 5.3 CVE-2017-1000246 < 4.6.0 4.6.0
  6. High · 7.5 CVE-2016-10149 < 4.5.0 4.5.0
  7. Critical · 9.0 CVE-2016-10127 < 4.5.0 4.5.0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.