CVE-2013-4314: pyopenssl - Spoofing SSL Servers via Crafted Certificate

pyopenssl Updated 02 Oct 2025

Summary

30/09/2013
Yes i
High
7.5

CVE-2013-4314: The X509Extension in pyOpenSSL before 0.13.1 does not properly handle a '\0' character in a domain name in the Subject Alternative Name field of an X.509 certificate, which allows man-in-the-middle attackers to spoof arb... Affects pyopenssl versions < 0.13.1. Fixed in 0.13.1. How to fix ↓

Also tracked for

The same CVE-2013-4314 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

pyopenssl is a Python library that provides a high-level interface to the OpenSSL library, allowing developers to integrate SSL/TLS functionality into their Python applications. It is commonly used for secure communication over networks. However, prior to version 0.13.1, pyopenssl is vulnerable to a spoofing attack that allows an attacker to impersonate arbitrary SSL servers using a crafted certificate issued by a legitimate Certification Authority.

Vulnerability Detail

The vulnerability lies in the X509Extension component of pyopenssl. When processing the Subject Alternative Name field of an X.509 certificate, pyopenssl fails to properly handle a '\0' character in a domain name. This flaw can be exploited by a man-in-the-middle attacker to create a certificate with a malicious domain name that appears valid to the victim's browser or application. As a result, the attacker can intercept and manipulate secure communications, leading to potential data leakage or unauthorized access.

How To Fix

Minimum fixed version

0.13.1

This is the first release that contains the fix.

pip install --upgrade "pyopenssl==0.13.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to update to the latest version of pyopenssl as soon as possible.

Conclusion

The vulnerability in pyopenssl prior to version 0.13.1 allows for SSL server spoofing through the use of a crafted certificate. To mitigate this risk, it is crucial to update to the latest version of pyopenssl. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for pyopenssl →

Share this vulnerability

FAQ

You can check the version of pyopenssl by running the following command:

pip show pyopenssl

No, this vulnerability affects all systems where pyopenssl version 0.13.0 or earlier is installed.

Yes, an attacker can exploit this vulnerability remotely by intercepting the victim's network traffic and presenting a crafted certificate.

There are no known instances of this vulnerability being actively exploited at this time.

You can find more information about this vulnerability in the official pyopenssl advisory: [link to advisory]

Related vulnerabilities

Recent vulnerabilities recorded for pyopenssl.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

0.13.1

This is the first release that contains the fix.

pip install --upgrade "pyopenssl==0.13.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback