Skip to content

Null pointer dereference in PKCS12 parsing

Moderate severity GitHub Reviewed Published Jan 26, 2024 to the GitHub Advisory Database • Updated Feb 16, 2024

Package

pip cryptography (pip)

Affected versions

< 42.0.2

Patched versions

42.0.2

Description

Issue summary: Processing a maliciously formatted PKCS12 file may lead OpenSSL
to crash leading to a potential Denial of Service attack

Impact summary: Applications loading files in the PKCS12 format from untrusted
sources might terminate abruptly.

A file in PKCS12 format can contain certificates and keys and may come from an
untrusted source. The PKCS12 specification allows certain fields to be NULL, but
OpenSSL does not correctly check for this case. This can lead to a NULL pointer
dereference that results in OpenSSL crashing. If an application processes PKCS12
files from an untrusted source using the OpenSSL APIs then that application will
be vulnerable to this issue.

OpenSSL APIs that are vulnerable to this are: PKCS12_parse(),
PKCS12_unpack_p7data(), PKCS12_unpack_p7encdata(), PKCS12_unpack_authsafes()
and PKCS12_newpass().

We have also fixed a similar issue in SMIME_write_PKCS7(). However since this
function is related to writing data we do not consider it security significant.

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

References

Published by the National Vulnerability Database Jan 26, 2024
Published to the GitHub Advisory Database Jan 26, 2024
Reviewed Feb 16, 2024
Last updated Feb 16, 2024

Severity

Moderate
5.5
/ 10

CVSS base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Weaknesses

No CWEs

CVE ID

CVE-2024-0727

GHSA ID

GHSA-9v9h-cgj8-h64p

Source code

No known source code

Credits

Checking history
See something to contribute? Suggest improvements for this vulnerability.