Critical Vulnerability in py3-cryptography: Public Key Validation Flaw
Summary
ALPINE-CVE-2026-26007: cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. Affects py3-cryptography versions < 46.0.5-r0. Fixed in 46.0.5-r0. How to fix ↓
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
The py3-cryptography package is a widely used library in Python that provides cryptographic primitives and recipes for developers. It enables secure communication and data protection through various cryptographic algorithms. However, prior to version 46.0.5, the package contained a significant vulnerability related to the validation of public keys, specifically in its handling of elliptic curve cryptography.
Vulnerability Detail
The vulnerability arises from the public_key_from_numbers and related functions not verifying that the provided public key point belongs to the expected prime-order subgroup of the elliptic curve. This oversight allows attackers to use public keys from small-order subgroups, which can lead to severe security issues. For instance, when a victim computes a shared secret using ECDH, it can leak information about their private key. This is particularly dangerous for curves with a cofactor greater than 1, as it can expose the least significant bits of the private key. Additionally, weak public keys can facilitate signature forgery in ECDSA, making this a critical vulnerability that affects only SECT curves.
How To Fix
Minimum fixed version
46.0.5-r0
This is the first release that contains the fix.
sudo apk add --upgrade py3-cryptography
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There are no specific workarounds mentioned for this vulnerability. The best course of action is to update to the patched version of the package as outlined above.
Conclusion
The py3-cryptography package has a critical vulnerability that affects its public key validation process, potentially leading to severe security risks. It is essential for users to update to version 46.0.5 or later to mitigate these risks. Regular monitoring for vulnerabilities using tools like Vulert can help maintain the security of your applications.
See every vulnerability recorded for py3-cryptography →
FAQ
The CVSS score of this vulnerability is 6.5, indicating a medium severity level.
Versions prior to 46.0.5 are affected by this vulnerability.
This vulnerability can enable attacks such as private key leakage and signature forgery.
Yes, only SECT curves are impacted by this vulnerability.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time using just a manifest file like package-lock.json. You can check your application for vulnerabilities without any signup using the Vulert playground.
References
Related vulnerabilities
Recent vulnerabilities recorded for py3-cryptography.