VYPR
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.

PackageAffected versionsPatched versions
jwcryptoPyPI
< 0.3.20.3.2

Affected products

1

Patches

1
eb5be5bd94c8

CVE-2016-6298: Million Messages Attack mitigation

https://github.com/latchset/jwcryptoSimo SorceAug 29, 2016via ghsa
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

News mentions

0

No linked articles in our index yet.