Critical Vulnerability in Python Packages: CVE-2022-48560 - Use-After-Free Issue

python2.7 Updated 02 Oct 2025

Summary

22/08/2023
N/A
Yes i
High
7.5

UBUNTU-CVE-2022-48560: A use-after-free exists in Python through 3.9 via heappushpop in heapq. Affects python2.7 versions < 2.7.6-8ubuntu0.6+esm17. Fixed in 2.7.6-8ubuntu0.6+esm17. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Python is a widely-used high-level programming language known for its readability and versatility. It supports multiple programming paradigms and is commonly used in web development, data analysis, artificial intelligence, and more. The vulnerability CVE-2022-48560 affects various Python packages, particularly versions 2.7, 3.4, 3.5, 3.6, 3.7, and 3.8, which are utilized in numerous applications. This vulnerability could lead to severe security risks if not addressed promptly.

Vulnerability Detail

CVE-2022-48560 is a use-after-free vulnerability found in Python through version 3.9, specifically in the heappushpop function of the heapq module. This flaw allows an attacker to exploit the memory management of the Python interpreter, potentially leading to arbitrary code execution or crashes. The ramifications of this vulnerability can be significant, affecting the integrity and availability of applications relying on the affected Python versions.

How To Fix

Minimum fixed version

2.7.6-8ubuntu0.6+esm17

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python2.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate patching is not feasible, consider isolating the affected applications from untrusted inputs or environments. Implementing strict input validation and sanitization can help mitigate the risk until the package is updated.

Conclusion

CVE-2022-48560 presents a significant security risk to various Python packages. It is essential to update affected packages to their patched versions promptly to mitigate potential threats. Users should also consider implementing workarounds until updates can be applied.

See every vulnerability recorded for python2.7 →

Share this vulnerability

FAQ

CVE-2022-48560 is a use-after-free vulnerability in Python that can lead to arbitrary code execution or application crashes.

The vulnerability affects Python versions 2.7, 3.4, 3.5, 3.6, 3.7, and 3.8.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.

If you cannot update the package, consider implementing input validation and isolating affected applications from untrusted environments as a temporary workaround.

The CVSS score of CVE-2022-48560 is 7.5, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for python2.7.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.7.6-8ubuntu0.6+esm17

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python2.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback