CVE-2021-21239 Open default xmlsec1 key-type preference
Attackers can bypass SAML signature verification in PySAML2 by exploiting default xmlsec1 key-type preferences, allowing forged authentication assertions.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-21239?
CVE-2021-21239 is a medium-severity vulnerability in Debian Debian Linux, published on 21 Jan 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official 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. 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.
Weakness: CWE-347
Which versions are affected by CVE-2021-21239?
3 open source packages ship an affected version, including pysaml2. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
pysaml2 PyPI | All versions | 6.5.0 |
pysaml2 PyPI | All versions | 6.5.0 |
pysaml2 PyPI | All versions | 6.5.0 |
Products include Debian Debian Linux, Pysaml2 Project Pysaml2.
How do I fix CVE-2021-21239?
Upgrade pysaml2 to 6.5.0 or later.
Is CVE-2021-21239 being exploited?
There is no known exploitation of CVE-2021-21239 in the wild and no public exploit code.
Public exploit code: 4 proofs of concept on GitHub.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as DEBIAN-CVE-2021-21239, GHSA-5p3x-r448-pc62, PYSEC-2021-49, UBUNTU-CVE-2021-21239, USN-5066-1, USN-5066-2.