{"id":"CVE-2024-26130","aliases":["CVE-2024-26130","GHSA-6vqw-3v5j-54x4","PYSEC-2024-225"],"related":[],"kind":"vulnerability","state":"published","title":"cryptography NULL pointer deference with pkcs12.serialize_key_and_certificates when called with a non-matching certificate and private key and an hmac_hash override","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"If `pkcs12.serialize_key_and_certificates` is called with both:\n\n1. A certificate whose public key did not match the provided private key\n2. An `encryption_algorithm` with `hmac_hash` set (via `PrivateFormat.PKCS12.encryption_builder().hmac_hash(...)`\n\nThen a NULL pointer dereference would occur, crashing the Python process.\n\nThis has been resolved, and now a `ValueError` is properly raised.\n\nPatched in https://github.com/pyca/cryptography/pull/10423","format":"markdown","source":"ghsa"},{"lang":"es","text":"cryptography es un paquete manipulado para exponer recetas y primitivas criptográficas a los desarrolladores de Python. A partir de la versión 38.0.0 y anteriores a la versión 42.0.4, si se llama a `pkcs12.serialize_key_and_certificates` con un certificado cuya clave pública no coincide con la clave privada proporcionada y un `encryption_algorithm` con `hmac_hash` configurado (a través de `PrivateFormat .PKCS12.encryption_builder().hmac_hash(...)`, entonces se produciría una desreferencia del puntero NULL, bloqueando el proceso de Python. Esto se resolvió en la versión 42.0.4, la primera versión en la que se genera correctamente un `ValueError` .","source":"nvd"}],"published":"2024-02-21T16:28:18.632Z","modified":"2026-09-10T03:50:09.815Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"version":">= 38.0.0, < 42.0.4","status":"affected"}],"vendor":"pyca","product":"cryptography","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"38.0.0","fixed":"42.04","status":"affected"}],"vendor":"cryptography_project","product":"cryptography","cpe":"cpe:2.3:a:cryptography_project:cryptography:*:*:*:*:*:python:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"38.0.0","status":"affected","fixed":"42.0.4"}],"ecosystem":"PyPI","package":"cryptography","purl":"pkg:pypi/cryptography","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"38.0.0","fixed":"42.0.4"}],"vendor":"cryptography.io","product":"cryptography","cpe":"cpe:2.3:a:cryptography.io:cryptography:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"97d231672763cdb5959a3b191e692a362f1b9e55"},{"type":"ecosystem","introduced":"38.0.0","status":"affected","fixed":"42.0.4"}],"ecosystem":"PyPI","package":"cryptography","purl":"pkg:pypi/cryptography","repo":"https://github.com/pyca/cryptography","source":"pysec"}],"references":[{"url":"https://github.com/pyca/cryptography/security/advisories/GHSA-6vqw-3v5j-54x4","tags":["advisory","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pyca/cryptography/pull/10423","tags":["fix","issue-tracking","patch","report","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pyca/cryptography/commit/97d231672763cdb5959a3b191e692a362f1b9e55","tags":["fix","patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-26130","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pyca/cryptography","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/cryptography/PYSEC-2024-225.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-6vqw-3v5j-54x4","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2024-08-14T19:56:07.150Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-26130","url":"https://www.cve.org/CVERecord?id=CVE-2024-26130","licence":"CVE Terms of Use","modified":"2024-08-14T20:01:52.628Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6vqw-3v5j-54x4","url":"https://github.com/advisories/GHSA-6vqw-3v5j-54x4","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:09.815Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-26130","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-26130","licence":"Public domain","modified":"2026-06-17T07:17:09.793Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2024-225","url":"https://osv.dev/vulnerability/PYSEC-2024-225","licence":"CC-BY-4.0","modified":"2026-06-10T17:14:19.430Z"}],"updatedAt":"2026-11-25T22:58:36.967Z","epss":{"score":0.00831,"percentile":0.58687,"date":"2026-12-01T12:00:22.000Z"}}