cryptography is vulnerable to Integer Overflow or Wraparound
59
Medium Risk
The raw ChaCha20 cipher API treats the first four bytes of the 16-byte nonce as a 32-bit little-endian block counter per RFC 7539. Before the fix, encrypting or decrypting past that counter limit let the underlying implementation silently diverge from RFC 7539 instead of failing. An application that processes enough attacker-influenced data with a near-overflow counter can therefore continue with incorrect keystream material. The library now tracks processed bytes and raises ValueError before the counter would overflow.
You are affected if you are using a version that falls within the vulnerable range and calling the raw ChaCha20 cipher API (not only ChaCha20Poly1305) on attacker-influenced data volumes or nonce counter values.
cryptography is vulnerable to Integer Overflow or Wraparound in versions 2.1.0 - 48.0.1.
Upgrade the cryptography library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

SOC 2Compliant
ISO 27001Compliant