Vulnerabilities in pkg:pypi/rencode
PACKAGECVE-2021-40839 is a HIGH (CVSS 7.5) infinite loop vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Rencode libraries in the PyPI ecosystem. The issue involves infinite loop in rencode. Remediation is available in the latest vendor maintenance releases.
pkg:pypi/rencode
Vulnerability advisories affecting package pkg:pypi/rencode. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-gh8j-2pgf-x458 | CVE-2021-40839 | HIGH | Infinite Loop in rencode |
CVE-2021-40839 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2021-40839
To remediate this vulnerability, upgrade all affected Rencode dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install rencode>=Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show rencode
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2021-40839, inspect your installed packages using pip:
pip show rencode
Analyze the terminal output to locate any version of Rencode in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The pip show rencode command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Rencode, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-40839 Affected Rencode Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
rencode
|
PyPI |
≤ 1.0.6
|
|
References
Frequently Asked Questions
What is CVE-2021-40839?
Which Rencode versions are affected?
What version fixes CVE-2021-40839?
Is rencode affected?
What is the CVSS score of CVE-2021-40839?
What CWE is associated with CVE-2021-40839?
How can I check PyPI dependencies for CVE-2021-40839?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gh8j-2pgf-x458",
"modified" : "2024-10-26T18:35:18Z",
"published" : "2021-09-13T20:05:51Z",
"aliases" : [ "CVE-2021-40839" ],
"summary" : "Infinite Loop in rencode",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "rencode"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "1.0.6"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-40839"
}, {
"type" : "WEB",
"url" : "https://github.com/aresch/rencode/pull/29"
}, {
"type" : "WEB",
"url" : "https://github.com/aresch/rencode/commit/572ff74586d9b1daab904c6f7f7009ce0143bb75"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-gh8j-2pgf-x458"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/aresch/rencode"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/rencode/PYSEC-2021-345.yaml"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BMVQRPDVSVZNGGX57CFKCYT3DEYO4QB6"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MCLETLGVM5DBX6QNHQFW6TWGO5T3DENY"
}, {
"type" : "WEB",
"url" : "https://pypi.org/project/rencode/#history"
}, {
"type" : "WEB",
"url" : "https://seclists.org/fulldisclosure/2021/Sep/16"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20211008-0001"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-835" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-09-13T19:11:37Z",
"nvd_published_at" : "2021-09-10T02:15:00Z"
}
}