CVE-2018-10903: python-cryptography - Cryptography Flaw Allows GCM Tag Forgeries
Summary
CVE-2018-10903: PyCA Cryptography vulnerable to GCM tag forgery. Affects cryptography versions >= 1.9.0, < 2.3. Fixed in 2.3. How to fix ↓
Also tracked for
- python-cryptography · Debian:11
The same CVE-2018-10903 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
python-cryptography is a Python library that provides cryptographic recipes and primitives. It is widely used for secure communication, data integrity, and encryption. This vulnerability affects versions between >=1.9.0 and <2.3 of the library. The flaw lies in the finalize_with_tag API, which fails to enforce a minimum tag length. This oversight allows an attacker to craft an invalid payload with a shortened tag, increasing the chances of passing the MAC check. GCM tag forgeries can lead to key leakage, compromising the security of the cryptographic operations performed by the library.
Vulnerability Detail
The vulnerability (CVE-2018-10903) in python-cryptography arises due to the lack of enforcement of a minimum tag length in the finalize_with_tag API. By not validating the input length before passing it to finalize_with_tag, an attacker can create a malicious payload with a shortened tag. This increases the probability of passing the MAC check, allowing the attacker to forge GCM tags. Successful tag forgeries can result in key leakage, undermining the confidentiality and integrity of cryptographic operations.
How To Fix
Latest published version: 50.0.2 as of 22 Oct 2026
pip install --upgrade "cryptography==50.0.2"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
2.3
This is the first release that contains the fix.
pip install --upgrade "cryptography==2.3"
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 upgrade to the fixed version of the python-cryptography library to address the issue effectively.
Conclusion
The vulnerability in python-cryptography (CVE-2018-10903) allows for GCM tag forgeries, increasing the risk of key leakage. To mitigate this issue, it is crucial to upgrade to version 2.3 or later of the library. This upgrade ensures the enforcement of a minimum tag length and proper validation of input, safeguarding cryptographic operations. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for cryptography →
FAQ
python-cryptography is a Python library that provides cryptographic recipes and primitives. It is commonly used for secure communication, data integrity, and encryption.
Versions between >=1.9.0 and <2.3 of python-cryptography are affected by this vulnerability.
The vulnerability allows an attacker to forge GCM tags, increasing the chances of passing the MAC check. Successful tag forgeries can lead to key leakage, compromising the security of cryptographic operations.
To fix this vulnerability, it is recommended to upgrade to version 2.3 or later of the python-cryptography library.
No, there is no known workaround for this vulnerability. Upgrading to the fixed version is the recommended solution.
References
Related vulnerabilities
Recent vulnerabilities recorded for cryptography.