# CVE-2020-13757: Python-RSA decryption of ciphertext leads to DoS

> An attacker can cause excessive memory allocation or infer library usage by exploiting improper handling of leading null bytes during RSA decryption.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/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:** 1 Jun 2020
- **Updated:** 4 Aug 2024
- **Also known as:** DEBIAN-CVE-2020-13757, GHSA-537h-rv9q-vvph, MGASA-2020-0364, PYSEC-2020-99, SUSE-SU-2021:2008-1, SUSE-SU-2021:2237-1, SUSE-SU-2021:2253-1, SUSE-SU-2022:3287-1, UBUNTU-CVE-2020-13757, USN-4478-1, USN-4478-2, openSUSE-SU-2021:0901-1, openSUSE-SU-2021:2008-1

## What is CVE-2020-13757?

CVE-2020-13757 is a high-severity vulnerability in Canonical Ubuntu Linux, published on 1 Jun 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Python-RSA before 4.1 ignores leading '\0' bytes during decryption of ciphertext. This could conceivably have a security-relevant impact, e.g., by helping an attacker to infer that an application uses Python-RSA, or if the length of accepted ciphertext affects application behavior (such as by causing excessive memory allocation).

Weakness: CWE-327 (Use of a Broken or Risky Cryptographic Algorithm)

## Which versions are affected by CVE-2020-13757?

3 open source packages ship an affected version, including rsa. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rsa` | PyPI | All versions | 4.1 |
| `rsa` | PyPI | All versions | 4.1 |
| `rsa` | PyPI | All versions | 4.1 |
| `python-rsa` | SUSE:Enterprise Storage 6 | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:HPE Helion OpenStack 8 | All versions | 3.4.2-3.3.1 |
| `python-rsa` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Linux Enterprise Module for Basesystem 15 SP2 | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Linux Enterprise Module for Package Hub 15 SP2 | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Linux Enterprise Module for Package Hub 15 SP3 | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Linux Enterprise Module for Public Cloud 12 | All versions | 3.1.4-12.16.1 |
| `python-rsa` | SUSE:Linux Enterprise Module for Public Cloud 15 | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Manager Proxy 4.0 | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Manager Retail Branch Server 4.0 | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:Manager Server 4.0 | All versions | 3.4.2-3.4.1 |
| `python-rsa` | SUSE:OpenStack Cloud 7 | All versions | 3.1.4-12.16.1 |
| `python-rsa` | SUSE:OpenStack Cloud 8 | All versions | 3.4.2-3.3.1 |
| `python-rsa` | SUSE:OpenStack Cloud 9 | All versions | 3.4.2-4.4.1 |
| `python-rsa` | SUSE:OpenStack Cloud Crowbar 8 | All versions | 3.4.2-3.3.1 |
| `python-rsa` | SUSE:OpenStack Cloud Crowbar 9 | All versions | 3.4.2-4.4.1 |
| `python-rsa` | openSUSE:Leap 15.2 | All versions | 3.4.2-lp152.4.3.1 |
| `python-rsa` | openSUSE:Leap 15.3 | All versions | 3.4.2-3.4.1 |

Products: Canonical Ubuntu Linux, Fedoraproject Fedora, Python-Rsa Project Python-Rsa.

## How do I fix CVE-2020-13757?

Upgrade rsa to 4.1 or later.

## Is CVE-2020-13757 being exploited?

There is no known exploitation of CVE-2020-13757 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-2020-13757 and fix it if it is affected.

What it is: CVE-2020-13757 is a high-severity vulnerability in Canonical Ubuntu Linux, published on 1 Jun 2020. 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-2020-13757 in the wild and no public exploit code.

Affected packages and fixed versions:
- rsa (PyPI): affected all versions; fixed in 4.1
- rsa (PyPI): affected all versions; fixed in 4.1
- rsa (PyPI): affected all versions; fixed in 4.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-2020-13757/ (Markdown: https://insights.sbomify.com/CVE-2020-13757/index.md)
```

## Sources

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

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