# CVE-2026-27459: pyOpenSSL buffer overflow in DTLS cookie generation callback

Source: https://junglewise.ai/threats/cve-2026-27459-pyopenssl-buffer-overflow-in-dtls-cookie-generation-callback  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-03-18. Updated: 2026-06-30  
License: CC BY 4.0 with a link back

CVE-2026-27459 · Severity: critical · CVSS 9.8 · Published 2026-03-18

pyOpenSSL is a widely used Python library that provides secure communication capabilities for applications. A flaw in how it handles certain security callbacks could allow an attacker to cause a memory overflow, potentially leading to application crashes or unauthorized code execution. This affects services using DTLS (Datagram Transport Layer Security) that implement specific cookie generation routines.

Technologies: [pyopenssl (PyPI)](https://junglewise.ai/threats/technologies/pypi-pyopenssl). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-27459 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-27459 being exploited in the wild.

**How severe is CVE-2026-27459?** Critical severity, with a CVSS score of 9.8, published 18 March 2026.

**Which products and versions are affected?** pyopenssl (PyPI) ECOSYSTEM:introduced=22.0.0,fixed=26.0.0.

**Is there a fix for CVE-2026-27459?** Yes. pyopenssl (PyPI): upgrade to 26.0.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-27459 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-27459?** Check whether you run Pyopenssl or pyopenssl (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- pyopenssl (PyPI): upgrade to 26.0.0 or later

  ```sh
  pip install "pyopenssl>=26.0.0"
  ```


## Technical details

A buffer overflow vulnerability (CWE-120) exists in pyOpenSSL versions 22.0.0 through 25.3.0. The issue occurs when a user-provided callback to `set_cookie_generate_callback` returns a cookie value greater than 256 bytes (DTLS1_COOKIE_LENGTH). pyOpenSSL fails to validate the length of this return value before copying it into a fixed-size native buffer provided by the underlying OpenSSL library. An attacker can exploit this to corrupt adjacent memory, potentially leading to remote code execution or a denial-of-service condition. The vulnerability is patched in version 26.0.0, which now rejects overly long cookie values.

## Affected products

- pyca pyOpenSSL >=22.0.0, <26.0.0

## Identifiers

- CVE-2026-27459
- GHSA-5pwr-322w-8jr4
- PYSEC-2026-2269

## Timeline

- 2026-03-15: patched: Version 26.0.0 released with fix
- 2026-03-15: advisory: GitHub Security Advisory GHSA-5pwr-322w-8jr4 published
- 2026-03-18: disclosed: CVE-2026-27459 published to NVD

## References

- [https://github.com/pyca/pyopenssl/blob/358cbf29c4e364c59930e53a270116249581eaa3/CHANGELOG.rst](https://github.com/pyca/pyopenssl/blob/358cbf29c4e364c59930e53a270116249581eaa3/CHANGELOG.rst)
- [https://github.com/pyca/pyopenssl/commit/57f09bb4bb051d3bc2a1abd36e9525313d5cd408](https://github.com/pyca/pyopenssl/commit/57f09bb4bb051d3bc2a1abd36e9525313d5cd408)
- [https://github.com/pyca/pyopenssl/security/advisories/GHSA-5pwr-322w-8jr4](https://github.com/pyca/pyopenssl/security/advisories/GHSA-5pwr-322w-8jr4)
- [https://access.redhat.com/errata/RHSA-2026:10754](https://access.redhat.com/errata/RHSA-2026:10754)
- [https://access.redhat.com/errata/RHSA-2026:11856](https://access.redhat.com/errata/RHSA-2026:11856)
- [https://access.redhat.com/errata/RHSA-2026:11916](https://access.redhat.com/errata/RHSA-2026:11916)
- [https://access.redhat.com/errata/RHSA-2026:11996](https://access.redhat.com/errata/RHSA-2026:11996)

## Related threats

- [pyOpenSSL allows TLS connection bypass via unhandled callback exception in set_tlsext_servername_callback](https://junglewise.ai/threats/cve-2026-27448-pyopenssl-allows-tls-connection-bypass-via-unhandled-callback)
- [PyOpenSSL Use-After-Free vulnerability](https://junglewise.ai/threats/cve-2018-1000807-pyopenssl-use-after-free-vulnerability)
- [pyOpenSSL incorrect memory management in PKCS #12 handling](https://junglewise.ai/threats/cve-2018-1000808-pyopenssl-incorrect-memory-management-in-pkcs-12-handling)
- [PyOpenSSL Mishandles NUL Byte In Certificate Subject Alternative Name](https://junglewise.ai/threats/cve-2013-4314-pyopenssl-mishandles-nul-byte-in-certificate-subject-alternative)
