# CVE-2013-4314: PyOpenSSL Mishandles NUL Byte In Certificate Subject Alternative Name

> Man-in-the-middle attackers can spoof SSL servers by exploiting null byte handling in pyOpenSSL certificate validation.

- **Severity:** Medium 4.3 (`AV:N/AC:M/Au:N/C:N/I:P/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Sep 2013
- **Updated:** 6 Aug 2024
- **Also known as:** DEBIAN-CVE-2013-4314, DSA-2763-1, GHSA-6748-36qp-fx6r, MGASA-2013-0277, PYSEC-2013-31, openSUSE-SU-2024:10214-1, openSUSE-SU-2024:11253-1, openSUSE-SU-2024:14154-1, openSUSE-SU-2026:11470-1

## What is CVE-2013-4314?

CVE-2013-4314 is a medium-severity vulnerability in Canonical Ubuntu Linux, published on 30 Sep 2013. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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 arbitrary SSL servers via a crafted certificate issued by a legitimate Certification Authority.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2013-4314?

3 open source packages ship an affected version, including pyopenssl and pyOpenSSL. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `pyopenssl` | PyPI | All versions | 0.13.1 |
| `pyopenssl` | PyPI | All versions | 0.13.1 |
| `pyOpenSSL` | PyPI | All versions | 0.13.1 |
| `python-pyOpenSSL` | openSUSE:Tumbleweed | All versions | 24.1.0-1.2 |
| `python-pyOpenSSL` | openSUSE:Tumbleweed | All versions | 26.4.0-1.1 |

Products: Canonical Ubuntu Linux, Jean-Paul Calderone Pyopenssl.

## How do I fix CVE-2013-4314?

Upgrade pyopenssl to 0.13.1 or later.

## Is CVE-2013-4314 being exploited?

There is no known exploitation of CVE-2013-4314 in the wild and no public exploit code.

## Other vulnerabilities in Canonical Ubuntu Linux

- [CVE-2020-11651](https://insights.sbomify.com/CVE-2020-11651/): SaltStack Salt Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2020-7247](https://insights.sbomify.com/CVE-2020-7247/): OpenSMTPD Remote Code Execution (critical 9.8, exploited in the wild)
- [CVE-2019-16928](https://insights.sbomify.com/CVE-2019-16928/): Exim Out-of-bounds Write (critical 9.8, exploited in the wild)
- [CVE-2018-6789](https://insights.sbomify.com/CVE-2018-6789/): Exim Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2015-2590](https://insights.sbomify.com/CVE-2015-2590/): Oracle Java SE and Java SE Embedded Remote Code Execution (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2013-4314 and fix it if it is affected.

What it is: CVE-2013-4314 is a medium-severity vulnerability in Canonical Ubuntu Linux, published on 30 Sep 2013. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2013-4314 in the wild and no public exploit code.

Affected packages and fixed versions:
- pyopenssl (PyPI): affected all versions; fixed in 0.13.1
- pyopenssl (PyPI): affected all versions; fixed in 0.13.1
- pyOpenSSL (PyPI): affected all versions; fixed in 0.13.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2013-4314/ (Markdown: https://insights.sbomify.com/CVE-2013-4314/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2013-4314
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2013-4314
- OSV: https://osv.dev/vulnerability/CVE-2013-4314

---
From sbomify Insights: https://insights.sbomify.com/CVE-2013-4314/
Summaries are generated and may contain mistakes; the official description above is the record.
