cryptography@42.0.7 vulnerabilities

cryptography is a package which provides cryptographic recipes and primitives to Python developers.

Direct Vulnerabilities

Known vulnerabilities in the cryptography package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • H
Use After Free

Affected versions of this package are vulnerable to Use After Free via the SSL_free_buffers function. An attacker can execute arbitrary code, corrupt valid data or cause a crash by exploiting the freed memory area.

The SSL_free_buffers function is used to free the internal OpenSSL buffer used when processing an incoming record from the network. The call is only expected to succeed if the buffer is not currently in use. However, two scenarios have been identified where the buffer is freed even when still in use.

  1. The first scenario occurs where a record header has been received from the network and processed by OpenSSL, but the full record body has not yet arrived. In this case calling SSL_free_buffers will succeed even though a record has only been partially processed and the buffer is still in use.

  2. The second scenario occurs where a full record containing application data has been received and processed by OpenSSL but the application has only read part of this data. Again a call to SSL_free_buffers will succeed even though the buffer is still in use.

While these scenarios could occur accidentally during normal operation a malicious attacker could attempt to engineer a situation where this occurs.

Note:

The FIPS modules in 3.3, 3.2, 3.1 and 3.0 are not affected by this issue.

How to fix Use After Free?

A fix was pushed into the master branch but not yet published.

[35.0.0,)
  • L
Uncontrolled Resource Consumption

Affected versions of this package are vulnerable to Uncontrolled Resource Consumption due to improper user input validation in the EVP_PKEY_param_check or EVP_PKEY_public_check functions. An attacker can cause a denial of service by supplying excessively long DSA keys or parameters obtained from an untrusted source.

Note:

OpenSSL does not call these functions on untrusted DSA keys, so only applications that directly call these functions may be vulnerable.

Also vulnerable are the OpenSSL pkey and pkeyparam command line applications when using the "-check" option.

How to fix Uncontrolled Resource Consumption?

A fix was pushed into the master branch but not yet published.

[0,)