CVE-2021-40839
Infinite Loop in rencode
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used 7.5
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory.
- Record
CVE-2021-40839- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:N/I:N/A:P - Weakness
- CWE-835
- Updated
- 2026-11-02
CVE ListNo score
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory.
- Record
CVE-2021-40839- Updated
- 2026-11-02
EUVDEUVD-2021-0222No score
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory.
- Record
EUVD-2021-0222- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-gh8j-2pgf-x458 8.7
Infinite Loop in rencode
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory.
- Record
GHSA-gh8j-2pgf-x458- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-835
- Updated
- 2026-11-02
OSVALPINE-CVE-2021-40839 7.5
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory.
- Record
ALPINE-CVE-2021-40839- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-03
OSV 7.5
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory.
- Record
CVE-2021-40839- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
Show 5 moreShow less
OSVDEBIAN-CVE-2021-40839 7.5
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory.
- Record
DEBIAN-CVE-2021-40839- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVGHSA-gh8j-2pgf-x458 8.7
Infinite Loop in rencode
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory.
- Record
GHSA-gh8j-2pgf-x458- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-835
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2021-40839 7.5
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory.
- Record
UBUNTU-CVE-2021-40839- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVMGASA-2022-0167No score
Updated python-rencode packages fix security vulnerability
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory. (CVE-2021-40839)
- Record
MGASA-2022-0167- Updated
- 2026-11-02
OSVPYSEC-2021-345No score
The rencode package through 1.0.6 for Python allows an infinite loop in typecode decoding (such as via ;\x2f\x7f), enabling a remote attack that consumes CPU and memory.
- Record
PYSEC-2021-345- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
rencodePyPI | through 1.0.6 | None known |
py3-rencodeAlpine:v3.17 | before 1.0.6-r7 | 1.0.6-r7 |
py3-rencodeAlpine:v3.18 | before 1.0.6-r7 | 1.0.6-r7 |
py3-rencodeAlpine:v3.19 | before 1.0.6-r7 | 1.0.6-r7 |
py3-rencodeAlpine:v3.20 | before 1.0.6-r7 | 1.0.6-r7 |
py3-rencodeAlpine:v3.21 | before 1.0.6-r7 | 1.0.6-r7 |
py3-rencodeAlpine:v3.22 | before 1.0.6-r7 | 1.0.6-r7 |
py3-rencodeAlpine:v3.23 | before 1.0.6-r7 | 1.0.6-r7 |
py3-rencodeAlpine:v3.24 | before 1.0.6-r7 | 1.0.6-r7 |
python-rencodeDebian:12 | before 1.0.6-2 | 1.0.6-2 |
Show 9 moreShow less
| Package | Affected | Fixed |
|---|---|---|
python-rencodeDebian:13 | before 1.0.6-2 | 1.0.6-2 |
python-rencodeDebian:14 | before 1.0.6-2 | 1.0.6-2 |
rencodePyPI | through 1.0.6, plus listed versions 1.0.31.0.41.0.5 | None known |
python-rencodeMageia:8 | before 1.0.6-2.1.mga8 | 1.0.6-2.1.mga8 |
rencodePyPI | All versions, plus listed versions 1.0.31.0.41.0.51.0.61.0.71.0.8 | None known |
python-rencodeUbuntu:16.04:LTS | All versions, plus listed versions 1.0.3-1build11.0.3-1build2 | None known |
python-rencodeUbuntu:18.04:LTS | All versions, plus listed versions 1.0.5-1build2 | None known |
python-rencodeUbuntu:20.04:LTS | All versions, plus listed versions 1.0.5-1build41.0.5-1build51.0.5-1.11.0.6-11.0.6-1build1 | None known |
python-rencodeUbuntu:22.04:LTS | All versions, plus listed versions 1.0.6-1build31.0.6-21.0.6-2build1 | None known |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | itlabbet/CVE-2021-40839 | 2021-12-13 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases, references | OSV | |
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-40839 is a high vulnerability (CVSS 7.5) in Rencode Project Rencode, published September 10, 2021. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 5.52%, the 92nd percentile. Fixed in py3-rencode 1.0.6-r7.
References
github.com/aresch/rencode/pull/29
seclists.org/fulldisclosure/2021/Sep/16
github.com/aresch/rencode/commit/572ff74586d9b1daab904c6f7f7009ce0143bb75
pypi.org/project/rencode
security.netapp.com/advisory/ntap-20211008-0001
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BMVQRPDVSVZNGGX57CFKCYT3DEYO4QB6
Show 14 moreShow less
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MCLETLGVM5DBX6QNHQFW6TWGO5T3DENY
nvd.nist.gov/vuln/detail/CVE-2021-40839
github.com/advisories/GHSA-gh8j-2pgf-x458
github.com/pypa/advisory-database/tree/main/vulns/rencode/PYSEC-2021-345.yaml
lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BMVQRPDVSVZNGGX57CFKCYT3DEYO4QB6
lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MCLETLGVM5DBX6QNHQFW6TWGO5T3DENY
security.alpinelinux.org/vuln/CVE-2021-40839
security-tracker.debian.org/tracker/CVE-2021-40839
github.com/aresch/rencode
advisories.mageia.org/MGASA-2022-0167.html
bugs.mageia.org/show_bug.cgi?id=30051
lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/MCLETLGVM5DBX6QNHQFW6TWGO5T3DENY
ubuntu.com/security/CVE-2021-40839
cve.org/CVERecord?id=CVE-2021-40839