CVE-2021-40839 Infinite Loop in rencode

High 7.5 Published Updated

A remote attacker can cause a denial of service by triggering an infinite loop in the rencode Python library's typecode decoding.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-40839?

CVE-2021-40839 is a high-severity denial of service vulnerability in Fedoraproject Fedora, published on 10 Sep 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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.

Weakness: CWE-835

Which versions are affected by CVE-2021-40839?

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

PackageAffectedFixed in
rencode PyPIAll versionsNone
rencode PyPIAll versions to 1.0.6None
rencode PyPIAll versions to 1.0.6None

Products include Fedoraproject Fedora, Rencode Project Rencode.

How do I fix CVE-2021-40839?

Upgrade to a fixed version.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2021-40839 being exploited?

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

Public exploit code: 1 proofs of concept on GitHub.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-40839, GHSA-gh8j-2pgf-x458, MGASA-2022-0167, PYSEC-2021-345, UBUNTU-CVE-2021-40839.

Is CVE-2021-40839 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free