Medium severity5.3NVD Advisory· Published Sep 1, 2016· Updated May 6, 2026
CVE-2016-6298
CVE-2016-6298
Description
The _Rsa15 class in the RSA 1.5 algorithm implementation in jwa.py in jwcrypto before 0.3.2 lacks the Random Filling protection mechanism, which makes it easier for remote attackers to obtain cleartext data via a Million Message Attack (MMA).
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
jwcryptoPyPI | < 0.3.2 | 0.3.2 |
Affected products
1Patches
1eb5be5bd94c8CVE-2016-6298: Million Messages Attack mitigation
1 file changed · +17 −0
jwcrypto/jwa.py+17 −0 modified@@ -379,6 +379,23 @@ class _Rsa15(_RSA, JWAAlgorithm): def __init__(self): super(_Rsa15, self).__init__(padding.PKCS1v15()) + def unwrap(self, key, bitsize, ek, headers): + self._check_key(key) + # Address MMA attack by implementing RFC 3218 - 2.3.2. Random Filling + # provides a random cek that will cause the decryption engine to + # run to the end, but will fail decryption later. + + # always generate a random cek so we spend roughly the + # same time as in the exception side of the branch + cek = _randombits(bitsize) + try: + cek = super(_Rsa15, self).unwrap(key, bitsize, ek, headers) + # always raise so we always run through the exception handling + # code in all cases + raise Exception('Dummy') + except Exception: # pylint: disable=broad-except + return cek + class _RsaOaep(_RSA, JWAAlgorithm):
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
9- github.com/latchset/jwcrypto/commit/eb5be5bd94c8cae1d7f3ba9801377084d8e5a7banvdIssue TrackingPatchVendor AdvisoryWEB
- github.com/latchset/jwcrypto/pull/66nvdIssue TrackingPatchWEB
- github.com/latchset/jwcrypto/releases/tag/v0.3.2nvdPatchVendor AdvisoryWEB
- www.securityfocus.com/bid/92729nvdBroken LinkThird Party AdvisoryVDB Entry
- github.com/advisories/GHSA-wg33-x934-3ghhghsaADVISORY
- github.com/latchset/jwcrypto/issues/65nvdIssue TrackingVendor AdvisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2016-6298ghsaADVISORY
- github.com/pypa/advisory-database/tree/main/vulns/jwcrypto/PYSEC-2016-4.yamlghsaWEB
- web.archive.org/web/20200227230613/http://www.securityfocus.com/bid/92729ghsaWEB
News mentions
0No linked articles in our index yet.