CVE-2020-5390: PySAML2 XML Signature Wrapping Vulnerability
Summary
CVE-2020-5390: PySAML2 before 5.0.0 does not check that the signature in a SAML document is enveloped and thus signature wrapping is effective, i.e., it is affected by XML Signature Wrapping (XSW). Affects pysaml2 across 3 version ranges.
< 5.0.0
< 5e9d5acbcd8ae45c4e736ac521fd2df5b1c62e25
< f27c7e7a7010f83380566a219fd6a290a00f2b6e
Fixed in f27c7e7a7010f83380566a219fd6a290a00f2b6e. How to fix ↓
Also tracked for
- python-pysaml2 · Debian:11
The same CVE-2020-5390 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
PySAML2 is a Python library for implementing SAML2 service providers and identity providers. It provides functionality for SAML message generation, parsing, and validation. The library is widely used in Python applications that require SAML-based authentication and authorization. However, PySAML2 versions prior to 5.0.0 are vulnerable to XML Signature Wrapping (XSW) attacks.
Vulnerability Detail
The XML Signature Wrapping vulnerability in PySAML2 allows an attacker to manipulate SAML documents by exploiting the way signatures are verified. The library does not properly check if the signature is enveloped, which enables signature wrapping attacks. By crafting a malicious SAML document, an attacker can deceive the verification process and use incorrect data. This vulnerability specifically affects the verification of signed assertions, potentially leading to unauthorized access or privilege escalation.
How To Fix
Minimum fixed version
f27c7e7a7010f83380566a219fd6a290a00f2b6e
This is the first release that contains the fix.
pip install --upgrade "pysaml2==f27c7e7a7010f83380566a219fd6a290a00f2b6e"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is crucial to apply the official fix by upgrading to PySAML2 version 5.0.0 or later.
Conclusion
The XML Signature Wrapping vulnerability in PySAML2 versions prior to 5.0.0 can lead to unauthorized access and privilege escalation. It is recommended to upgrade to the latest version of PySAML2 to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for pysaml2 →
FAQ
PySAML2 is a Python library for implementing SAML2 service providers and identity providers. It is commonly used in Python applications that require SAML-based authentication and authorization.
XML Signature Wrapping is an attack technique where an attacker manipulates the signature verification process by separating the signature from the signed data. This can lead to the use of incorrect data and potential security vulnerabilities.
The vulnerability in PySAML2 can allow an attacker to manipulate SAML documents and potentially gain unauthorized access or escalate privileges within affected applications.
To fix this vulnerability, it is recommended to upgrade PySAML2 to version 5.0.0 or later. This version includes a fix for the XML Signature Wrapping vulnerability.
No, there is no known workaround for this vulnerability. It is crucial to apply the official fix by upgrading to PySAML2 version 5.0.0 or later.
References
Related vulnerabilities
Recent vulnerabilities recorded for pysaml2.