CVE-2024-9979 Pyo3: risk of use-after-free in `borrowed` reads from python weak references

Medium 5.3 Published Updated

Attackers can trigger use-after-free via unsound borrowing from weak Python references, potentially causing memory corruption or crashes in applications using PyO3.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-9979?

CVE-2024-9979 is a medium-severity use after free vulnerability in Red Hat Ansible Automation Platform 2, published on 15 Oct 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

A flaw was found in PyO3. This vulnerability causes a use-after-free issue, potentially leading to memory corruption or crashes via unsound borrowing from weak Python references.

Weakness: CWE-416

Which versions are affected by CVE-2024-9979?

3 open source packages ship an affected version, including pyo3.

PackageAffectedFixed in
pyo3 crates.ioFrom 0.22.00.22.4
pyo3 crates.ioFrom 0.22.00.22.4
pyo3 crates.ioFrom 0.22.00.22.4

How do I fix CVE-2024-9979?

Upgrade pyo3 to 0.22.4 or later.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2024-9979 being exploited?

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

Sources

Also known as DEBIAN-CVE-2024-9979, GHSA-6jgw-rgmm-7cv6, RUSTSEC-2024-0378.

Is CVE-2024-9979 in your software?

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

Check your SBOMs for free