CVE-2026-27459: pyOpenSSL Buffer Overflow Vulnerability in DTLS Cookie Callback
Summary
CVE-2026-27459: pyOpenSSL DTLS cookie callback buffer overflow. Affects pyopenssl versions >= 22.0.0, < 26.0.0. Fixed in 26.0.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
pyOpenSSL is a Python library that provides a high-level interface to OpenSSL, enabling developers to implement secure communication protocols. It supports various cryptographic operations and is widely used in applications requiring SSL/TLS functionalities. However, a recent vulnerability has been identified in the DTLS cookie callback mechanism, which can lead to severe security risks if exploited.
Vulnerability Detail
The vulnerability arises from a buffer overflow condition when a user-defined callback function for generating DTLS cookies returns a value exceeding 256 bytes. This overflow can lead to memory corruption, potentially allowing an attacker to execute arbitrary code or crash the application. The issue is rooted in the handling of cookie values, which were not adequately validated before being processed, exposing the application to significant security threats.
How To Fix
Minimum fixed version
26.0.0
This is the first release that contains the fix.
pip install --upgrade "pyopenssl==26.0.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, developers can implement a validation check in their callback function to ensure that the cookie value does not exceed 256 bytes. For example:
def my_cookie_callback():
cookie_value = generate_cookie()
if len(cookie_value) > 256:
raise ValueError('Cookie value exceeds maximum length')
return cookie_value
Conclusion
The buffer overflow vulnerability identified as CVE-2026-27459 in the pyOpenSSL library poses significant risks to applications using this library for DTLS cookie generation. It is crucial to update to the patched version 26.0.0 or later to mitigate these risks effectively.
See every vulnerability recorded for pyopenssl →
FAQ
CVE-2026-27459 is a vulnerability in the pyOpenSSL library that can lead to a buffer overflow due to improper handling of DTLS cookie values.
If your application uses pyOpenSSL and allows user-defined cookie generation, it may be susceptible to this buffer overflow, leading to potential security breaches.
The CVSS score for this vulnerability is 7.2, indicating a high severity level.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If an immediate update is not possible, implement a validation check in your cookie generation callback to ensure cookie values do not exceed 256 bytes.
References
Related vulnerabilities
Recent vulnerabilities recorded for pyopenssl.