{"id":"CVE-2026-120667","aliases":["CVE-2026-120667"],"related":[],"kind":"vulnerability","state":"published","title":"Heap Buffer Overflow When Re-Encoding Cached ASN.1 Items Above INT_MAX","summary":"Issue summary: An application that parses a maliciously crafted DER CRL,\ncertificate or CSR from a buffer larger than 4 GiB may trigger a heap buffer\noverflow when OpenSSL re-encodes the item's cached encoding.\n\nImpact summary: An attacker who supplies a crafted CRL, certificate or CSR to\nan application that parses untrusted DER from a buffer larger than 4 GiB\ncauses a heap out-of-bounds write of attacker-controlled data, crashing the\nprocess: Denial of Service.\n\nCWE: CWE-787: Out-of-bounds Write\n\nDescription: ASN1_item_i2d() encodes an item in two passes, sizing the buffer\nfirst and writing it second. For an item with a cached DER encoding,\nossl_asn1_enc_restore() reports that length through an int while copying the\nfull long. A cached encoding longer than INT_MAX is reported truncated, so the\ncaller allocates a small buffer and the second pass copies the whole span into\nit.\n\nThe cache is kept for the signed parts of CRLs, certificates and CSRs. Parsing\na CRL reaches it: d2i_X509_CRL() fingerprints the CRL and re-encodes that\npart, and a CRL inside PKCS#7 or CMS triggers it when the container is parsed.\nCertificates reach it at the first X509_verify() or extension-cache\nfingerprint, CSRs at X509_REQ_verify(). The attacker must supply a DER object\nwhose signed part spans more than 2^32 bytes from a buffer of at least 4 GiB,\non a platform with a 64-bit long. TLS, the HTTP CRL fetch, the BIO, PEM,\ndecoder and store readers cap input below 4 GiB.\n\nThe oversized copy runs off the end of the heap mapping and the process dies.\nNothing is read out of bounds or returned to the attacker, and the fixed\noverrun size leaves no partial overwrite to steer.\n\nFIPS impact: no\nThe affected code is outside the FIPS module boundary.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Issue summary: An application that parses a maliciously crafted DER CRL,\ncertificate or CSR from a buffer larger than 4 GiB may trigger a heap buffer\noverflow when OpenSSL re-encodes the item's cached encoding.\n\nImpact summary: An attacker who supplies a crafted CRL, certificate or CSR to\nan application that parses untrusted DER from a buffer larger than 4 GiB\ncauses a heap out-of-bounds write of attacker-controlled data, crashing the\nprocess: Denial of Service.\n\nCWE: CWE-787: Out-of-bounds Write\n\nDescription: ASN1_item_i2d() encodes an item in two passes, sizing the buffer\nfirst and writing it second. For an item with a cached DER encoding,\nossl_asn1_enc_restore() reports that length through an int while copying the\nfull long. A cached encoding longer than INT_MAX is reported truncated, so the\ncaller allocates a small buffer and the second pass copies the whole span into\nit.\n\nThe cache is kept for the signed parts of CRLs, certificates and CSRs. Parsing\na CRL reaches it: d2i_X509_CRL() fingerprints the CRL and re-encodes that\npart, and a CRL inside PKCS#7 or CMS triggers it when the container is parsed.\nCertificates reach it at the first X509_verify() or extension-cache\nfingerprint, CSRs at X509_REQ_verify(). The attacker must supply a DER object\nwhose signed part spans more than 2^32 bytes from a buffer of at least 4 GiB,\non a platform with a 64-bit long. TLS, the HTTP CRL fetch, the BIO, PEM,\ndecoder and store readers cap input below 4 GiB.\n\nThe oversized copy runs off the end of the heap mapping and the process dies.\nNothing is read out of bounds or returned to the attacker, and the fixed\noverrun size leaves no partial overwrite to steer.\n\nFIPS impact: no\nThe affected code is outside the FIPS module boundary.","source":"cvelist"}],"published":"2026-12-01T16:36:21.747Z","modified":"2026-12-01T17:17:20.510Z","severity":{"scorer":"CISA-ADP","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":"CISA-ADP","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-787"],"affected":[{"ranges":[{"type":"semver","introduced":"4.1.0","fixed":"4.1.1","status":"affected"},{"type":"semver","introduced":"4.0.0","fixed":"4.0.4","status":"affected"}],"vendor":"OpenSSL","product":"OpenSSL","source":"cvelist"}],"references":[{"url":"https://openssl-library.org/news/secadv/20261201.txt","tags":["vendor-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/openssl/openssl/commit/8257d58a42033fd7ea4cc439cddcb0c71a879d47","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://github.com/openssl/openssl/commit/e70e09fbecc5c1dc2dd159cb63216bf06318e579","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":["Bhabani Sankar Das","Nikola Pajkovsky"],"assigner":"openssl","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-12-01T16:52:25.402Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-120667","url":"https://www.cve.org/CVERecord?id=CVE-2026-120667","licence":"CVE Terms of Use","modified":"2026-12-01T16:52:29.515Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-120667","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-120667","licence":"Public domain","modified":"2026-12-01T17:17:20.510Z"}],"updatedAt":"2026-12-01T17:32:19.548Z"}