CVE-2021-40839 json
Infinite Loop in rencode
published 5y ago modified 4mo ago also GHSA-gh8j-2pgf-x458 , PYSEC-2021-345 , EUVD-2021-0222
- cvss
- 7.5
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 5.5%
- EPSS 5.5% chance of exploitation in 30 days, percentile 92%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- python-rencode Debian 14, Debian 13, Debian 12 1.0.6-2
debian advisories DEBIAN-CVE-2021-40839
- py3-rencode Alpine 3.24, Alpine 3.23, Alpine 3.22 +5 more 1.0.6-r7
alpine advisories ALPINE-CVE-2021-40839
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- github.com/aresch/rencode@572ff74 commit
- github.com/aresch/rencode#29 pull request
Is CVE-2021-40839 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-40839 updated cvss 7.5
python-rencode: an infinite loop in typecode decoding allowing a remote DoS
-
Red Hat All currently supported Red Hat productsnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
5.52% chance of exploitation in the next 30 days, higher than 92% of all scored CVEs (FIRST EPSS, 2026-11-09).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 2.0 | 5.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
| GitHub | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | rencode | <=1.0.6 all versions |
no fix listed |
Classification
- Weakness
-
- CWE-835 Loop with Unreachable Exit Condition
References
-
github.com
/aresch/rencode/pull/29
web, patch, third-party-advisory
-
github.com
/aresch/rencode/commit/572ff74586d9b1daab904c6f7f7009ce0143bb75
web, patch, third-party-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/BMVQRPDVSVZNGGX57CFKCYT3DEYO4QB6/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/MCLETLGVM5DBX6QNHQFW6TWGO5T3DENY/
vendor-advisory
-
seclists.org
/fulldisclosure/2021/Sep/16
web, mailing-list, third-party-advisory
-
pypi.org
/project/rencode/#history
web, third-party-advisory, package
-
security.netapp.com
/advisory/ntap-20211008-0001/
third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-40839
advisory
-
github.com
/advisories/GHSA-gh8j-2pgf-x458
advisory
-
github.com
/aresch/rencode
package
-
github.com
/pypa/advisory-database/tree/main/vulns/rencode/PYSEC-2021-345.yaml
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/BMVQRPDVSVZNGGX57CFKCYT3DEYO4QB6
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/MCLETLGVM5DBX6QNHQFW6TWGO5T3DENY
web
-
security.netapp.com
/advisory/ntap-20211008-0001
web
Sources
- CVE List CVE-2021-40839
- GitHub Advisory GHSA-gh8j-2pgf-x458
- NVD CVE-2021-40839
- OSV PYSEC-2021-345
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.