# CVE-2018-20406: Integer overflow in n/a

> An integer overflow in Python's pickle module can cause memory exhaustion, leading to denial of service when processing extremely large serialized data.

- **Severity:** High 7.5 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Dec 2018
- **Updated:** 15 Oct 2026
- **Also known as:** ALPINE-CVE-2018-20406, GHSA-p5h6-p5x2-5qxf, PSF-2018-6, UBUNTU-CVE-2018-20406

## What is CVE-2018-20406?

CVE-2018-20406 is a high-severity vulnerability in Debian Debian Linux, published on 23 Dec 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Modules/_pickle.c in Python before 3.7.1 has an integer overflow via a large LONG_BINPUT value that is mishandled during a "resize to twice the size" attempt. This issue might cause memory exhaustion, but is only relevant if the pickle format is used for serializing tens or hundreds of gigabytes of data. This issue is fixed in: v3.4.10, v3.4.10rc1; v3.5.10, v3.5.10rc1, v3.5.7, v3.5.7rc1, v3.5.8, v3.5.8rc1, v3.5.8rc2, v3.5.9; v3.6.10, v3.6.10rc1, v3.6.11, v3.6.11rc1, v3.6.12, v3.6.7, v3.6.7rc1, v3.6.7rc2, v3.6.8, v3.6.8rc1, v3.6.9, v3.6.9rc1; v3.7.1, v3.7.1rc1, v3.7.1rc2, v3.7.2, v3.7.2rc1, v3.7.3, v3.7.3rc1, v3.7.4, v3.7.4rc1, v3.7.4rc2, v3.7.5, v3.7.5rc1, v3.7.6, v3.7.6rc1, v3.7.7, v3.7.7rc1, v3.7.8, v3.7.8rc1, v3.7.9.

Weakness: CWE-190 (Integer Overflow or Wraparound)

## Which versions are affected by CVE-2018-20406?

It affects 3 products.


Products: Debian Debian Linux, Fedoraproject Fedora, Python Python.

## How do I fix CVE-2018-20406?

Upgrade to a fixed version.

## Is CVE-2018-20406 being exploited?

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

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2018-20406 and fix it if it is affected.

What it is: CVE-2018-20406 is a high-severity vulnerability in Debian Debian Linux, published on 23 Dec 2018. 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-2018-20406 in the wild and no public exploit code.

Affected product: Debian Debian Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

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-2018-20406/ (Markdown: https://insights.sbomify.com/CVE-2018-20406/index.md)
```

## Sources

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

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