Executive brief
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.
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
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/commit/57f09bb4bb051d3bc2a1abd36e9525313d5cd408
- 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:11856
- https://access.redhat.com/errata/RHSA-2026:11916
- https://access.redhat.com/errata/RHSA-2026:11996