CVE-2024-21272: mysql-connector-python Connector Takeover Vulnerability

mysql-connector-python Updated 07 Jul 2026

Summary

07/07/2026
Yes i
High
7.5

CVE-2024-21272: MySQL Connector/Python connector takeover vulnerability. Affects mysql-connector-python versions < 9.1.0. Fixed in 9.1.0. 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

MySQL Connector/Python is a popular library that enables Python applications to connect to MySQL databases. It provides a Python interface for MySQL, allowing developers to execute SQL queries, manage database connections, and handle data in a Pythonic way. The library is widely used in web applications, data analysis, and other software that requires database interaction. However, certain versions of this connector are vulnerable to a security flaw that can be exploited by low-privileged attackers.

Vulnerability Detail

The vulnerability in MySQL Connector/Python arises from a flaw that allows low-privileged attackers with network access to compromise the connector. This issue affects versions 9.0.0 and prior, making it possible for attackers to take over the MySQL Connectors. The vulnerability has a CVSS 3.1 Base Score of 7.5, indicating significant impacts on confidentiality, integrity, and availability. Exploiting this vulnerability could lead to unauthorized access and manipulation of database connections.

How To Fix

Latest published version: 26.10.0 as of 23 Oct 2026

pip install --upgrade "mysql-connector-python==26.10.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

9.1.0

This is the first release that contains the fix.

pip install --upgrade "mysql-connector-python==9.1.0"

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

Workaround

If immediate upgrading is not feasible, consider restricting network access to the MySQL Connector/Python to trusted sources only. This can help mitigate the risk of exploitation until the package is updated.

Conclusion

The MySQL Connector/Python vulnerability (CVE-2024-21272) poses a significant risk to applications using affected versions. It is crucial to update to version 9.1.0 or later to safeguard against potential attacks. Additionally, using tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for mysql-connector-python →

Share this vulnerability

FAQ

CVE-2024-21272 is a vulnerability in the MySQL Connector/Python that allows low-privileged attackers to take over the connector, affecting versions 9.0.0 and prior.

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

The CVSS score of this vulnerability is 7.5, indicating a high level of risk.

If you cannot upgrade immediately, restrict network access to the MySQL Connector/Python to trusted sources to mitigate the risk.

Related vulnerabilities

Recent vulnerabilities recorded for mysql-connector-python.

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

Latest published version: 26.10.0 as of 23 Oct 2026

pip install --upgrade "mysql-connector-python==26.10.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

9.1.0

This is the first release that contains the fix.

pip install --upgrade "mysql-connector-python==9.1.0"

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