Description
cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. Starting in version 38.0.0 and prior to version 42.0.4, if `pkcs12.serialize_key_and_certificates` is called with both a certificate whose public key did not match the provided private key and an `encryption_algorithm` with `hmac_hash` set (via `PrivateFormat.PKCS12.encryption_builder().hmac_hash(...)`, then a NULL pointer dereference would occur, crashing the Python process. This has been resolved in version 42.0.4, the first version in which a `ValueError` is properly raised.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| pyca | cryptography | >= 38.0.0, < 42.0.4 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-cryptography | 42.0.5-1 | — |
| Debian 13 | python-cryptography | 42.0.5-1 | — |
| Debian 12 | python-cryptography | 38.0.4-3+deb12u1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 24.04 LTS | python-cryptography | 41.0.7-4ubuntu0.1 | USN-6673-3 |
| Ubuntu 22.04 LTS | python-cryptography | 3.4.8-1ubuntu2.2 | USN-6673-1 |
| Ubuntu 20.04 LTS | python-cryptography | 2.8-3ubuntu0.3 | USN-6673-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 18.04 LTS | python-cryptography | 2.1.4-1ubuntu1.4+esm1 | USN-6673-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 9 | python3.12-cryptography | 41.0.7-2.el9_6.1 | RHSA-2025:15608 |
Show 6 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Satellite Capsule 6 | python-cryptography +1 | 42.0.8-1.el8pc | RHSA-2024:7987 |
| Red Hat Satellite Capsule 6 | python-django +1 | 4.2.15-1.el8pc | RHSA-2024:7987 |
| Red Hat Satellite Capsule 6 | python-gunicorn +1 | 22.0.0-1.el8pc | RHSA-2024:7987 |
| Red Hat Satellite 6 | python-cryptography +1 | 42.0.8-1.el8pc | RHSA-2024:7987 |
| Red Hat Satellite 6 | python-django +1 | 4.2.15-1.el8pc | RHSA-2024:7987 |
| Red Hat Satellite 6 | python-gunicorn +1 | 22.0.0-1.el8pc | RHSA-2024:7987 |
| Red Hat Satellite 6 | rubygem-foreman_theme_satellite | 13.3.0-0.1.el8sat | RHSA-2024:7987 |
| Red Hat Satellite 6 | yggdrasil-worker-forwarder | 0.0.3-2.el8sat | RHSA-2024:7987 |
| Red Hat Rhui 4 | python-aiohttp +1 | 3.9.4-1.el8ui | RHSA-2025:1335 |
| Red Hat Rhui 4 | python-cryptography +1 | 42.0.8-1.el8ui | RHSA-2025:1335 |
| Red Hat Rhui 4 | python-django +1 | 4.2.15-1.el8ui | RHSA-2025:1335 |
| Red Hat Rhui 4 | python-grpcio +1 | 1.65.4-1.el8ui | RHSA-2025:1335 |
| Red Hat Rhui 4 | python-gunicorn +1 | 22.0.0-1.0.1.el8ui | RHSA-2025:1335 |
| Red Hat Rhui 4 | python-jinja2 +1 | 3.1.4-1.el8ui | RHSA-2025:1335 |
| Red Hat Rhui 4 | python-requests +1 | 2.32.3-2.el8ui | RHSA-2025:1335 |
| Red Hat Rhui 4 | python-sqlparse +1 | 0.5.0-1.el8ui | RHSA-2025:1335 |
| Red Hat Ansible Automation Platform Inside 2 | python-black +1 | 22.8.0-2.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Inside 2 | python-cryptography +1 | 42.0.5-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Inside 2 | python-jinja2 +1 | 3.1.4-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Inside 2 | python39-black +1 | 22.8.0-2.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Inside 2 | python39-cryptography +1 | 42.0.5-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Inside 2 | python39-jinja2 +1 | 3.1.4-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Inside 2 | receptor +1 | 1.4.8-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Developer 2 | python-black +1 | 22.8.0-2.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Developer 2 | python-cryptography +1 | 42.0.5-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Developer 2 | python-idna +1 | 3.7-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Developer 2 | python-jinja2 +1 | 3.1.4-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Developer 2 | python-requests +1 | 2.32.2-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Developer 2 | python39-black +1 | 22.8.0-2.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Developer 2 | python39-cryptography +1 | 42.0.5-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Developer 2 | python39-idna +1 | 3.7-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Developer 2 | python39-jinja2 +1 | 3.1.4-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Developer 2 | python39-requests +1 | 2.32.2-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform Developer 2 | receptor +1 | 1.4.8-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | automation-controller-venv-tower | 4.5.7-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | automation-hub +2 | 4.9.2-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-aiohttp +1 | 3.9.5-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-black +1 | 22.8.0-2.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-cryptography +1 | 42.0.5-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-galaxy-ng +1 | 4.9.2-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-gunicorn +1 | 22.0.0-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-idna +1 | 3.7-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-jinja2 +1 | 3.1.4-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-pillow +1 | 10.3.0-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-pydantic +1 | 1.10.15-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-requests +1 | 2.32.2-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-social-auth-app-django +1 | 5.4.1-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python-sqlparse +1 | 0.5.0-1.el9ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python39-aiohttp +1 | 3.9.5-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python39-black +1 | 22.8.0-2.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python39-cryptography +1 | 42.0.5-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python39-gunicorn +1 | 22.0.0-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python39-idna +1 | 3.7-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python39-jinja2 +1 | 3.1.4-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python39-pillow +1 | 10.3.0-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python39-pydantic +1 | 1.10.15-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python39-requests +1 | 2.32.2-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python39-social-auth-app-django +1 | 5.4.1-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | python39-sqlparse +1 | 0.5.0-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2 | receptor +1 | 1.4.8-1.el8ap | RHSA-2024:3781 |
AlmaLinux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux 9 | python3.12-cryptography | 41.0.7-2.el9_6.1 | ALSA-2025:15608 |
Rocky Linux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Rocky Linux 9 | python3.12-cryptography | 41.0.7-2.el9_6.1 | RLSA-2025:15608 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 3 | python-cryptography | 41.0.3-150400.16.15.1 | SUSE-SU-2024:2138-1, SUSE-SU-2024:0763-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-cryptography | 42.0.4-1.1 | openSUSE-SU-2026:11468-1, openSUSE-SU-2024:13710-1 |
| openSUSE Leap 15.6 | python-cryptography | 41.0.3-150600.23.3.1 | SUSE-SU-2024:2138-1 |
| openSUSE Leap 15.5 | python-cryptography | 41.0.3-150400.16.15.1 | SUSE-SU-2024:0763-1 |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 9 | python3.12-cryptography | 41.0.7-2.el9_6.1 | ELSA-2025-15608 |
| Oracle Linux 8 | python3.12-cryptography | 41.0.7-1.0.1.el8 | ELSA-2025-20364 |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | airflow | 2.10.5-r44 | — |
| Wolfi rolling | az +1 | 2.58.0-r0 | — |
| Wolfi rolling | ggshield | 1.25.0-r0 | — |
| Wolfi rolling | kubeflow-pipelines | 2.0.5-r3 | — |
| Wolfi rolling | mitmproxy | 12.2.1-r0 | — |
| Wolfi rolling | py3-cassandra-medusa +1 | 0.19.1-r1 | — |
| Wolfi rolling | py3-cryptography | 42.0.4-r0 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | cryptography | >= 38.0.0, < 42.0.4 | 42.0.4 | GHSA-6vqw-3v5j-54x4 |
Advisories 25
- ALSA-2025:15608 Important: python3.12-cryptography security update AlmaLinux Security Advisories · Oct 29, 2026
- WID-SEC-2024-1328 Red Hat Ansible Automation Platform: Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 18, 2026
- RHSA-2025:1335 Red Hat Security Advisory: RHUI 4.11 security, bugfix, and enhancement update Red Hat Security Advisories (RHSA) · Oct 17, 2026
- RHSA-2024:3781 Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update Red Hat Security Advisories (RHSA) · Oct 17, 2026
- RHSA-2024:7987 Red Hat Security Advisory: Satellite 6.15.4 Security Update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- openSUSE-SU-2026:11468-1 python313-cryptography-50.0.0-1.1 on GA media SUSE / openSUSE Security Updates · Aug 7, 2026
- RHSA-2025:15608 Red Hat Security Advisory: python3.12-cryptography security update Red Hat Security Advisories (RHSA) · Jul 3, 2026
- USN-6673-1 python-cryptography vulnerabilities Ubuntu Security Notices (USN) · Feb 10, 2026
- USN-6673-3 python-cryptography vulnerability Ubuntu Security Notices (USN) · Feb 10, 2026
- SUSE-SU-2024:2138-1 Security update for python-cryptography SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2024:0763-1 Security update for python-cryptography SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:13710-1 python310-cryptography-42.0.4-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- WID-SEC-2024-3377 Dell PowerProtect Data Domain: Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 12, 2025
- RLSA-2025:15608 Important: python3.12-cryptography security update Rocky Linux Security Advisories · Oct 10, 2025
- WID-SEC-2025-2025 Red Hat Enterprise Linux (python-cryptography): Schwachstelle ermöglicht Denial of Service BSI CERT-Bund (WID) · Oct 9, 2025
- WID-SEC-2025-0225 Dell PowerProtect Data Domain: Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 1, 2025
- WID-SEC-2024-0869 Oracle Communications: Mehrere Schwachstellen BSI CERT-Bund (WID) · Sep 10, 2025
- ELSA-2025-15608 Important: python3.12-cryptography security update (Oracle Linux 9) Oracle Linux Security Advisories (ELSA) · Sep 10, 2025
- ELSA-2025-20364 Important: python3.12-cryptography security update (Oracle Linux 8) Oracle Linux Security Advisories (ELSA) · Jun 6, 2025
- NCSC-2025-0028 Kwetsbaarheden verholpen in Oracle Analytics NCSC-NL (Netherlands) · Jan 22, 2025
- WID-SEC-2024-1642 Oracle Communications: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 20, 2024
- NCSC-2024-0412 Kwetsbaarheden verholpen in Oracle Peoplesoft NCSC-NL (Netherlands) · Oct 17, 2024
- NCSC-2024-0411 Kwetsbaarheden verholpen in Oracle Database producten NCSC-NL (Netherlands) · Oct 17, 2024
- WID-SEC-2024-3222 Oracle PeopleSoft: Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 15, 2024
- NCSC-2024-0294 Kwetsbaarheden verholpen in Oracle Communications NCSC-NL (Netherlands) · Jul 17, 2024