Vulnerabilities in pkg:pypi/mysql-connector-python
PACKAGECVE-2024-21272 is a HIGH (CVSS 7.5) mysql connector/python connector takeover vulnerability vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Mysql connector python libraries in the PyPI ecosystem. The issue involves mysql connector/python connector takeover vulnerability. Remediation is available by upgrading affected packages to version 9.1.0.
pkg:pypi/mysql-connector-python
Vulnerability advisories affecting package pkg:pypi/mysql-connector-python. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-hgjp-83m4-h4fj | CVE-2024-21272 | HIGH | MySQL Connector/Python connector takeover vulnerability |
| GHSA-2cf3-g243-hhfx | CVE-2017-3590 | LOW | MySQL Connectors Privilege Escalation |
| GHSA-v5rq-w2xm-7g5f | CVE-2019-2435 | HIGH | Improper Access Control in MySQL Connector Python |
CVE-2024-21272 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:H/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-21272
To remediate this vulnerability, upgrade all affected Mysql connector python 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 mysql-connector-python>=9.1.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show mysql-connector-python
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-21272, inspect your installed packages using pip:
pip show mysql-connector-python
Analyze the terminal output to locate any version of Mysql connector python in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.1.0), your application is affected.
Note: The pip show mysql-connector-python command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Mysql connector python, 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-2024-21272 Affected Mysql connector python Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mysql-connector-python
|
PyPI |
< 9.1.0
|
9.1.0
|
References
Frequently Asked Questions
What is CVE-2024-21272?
Which Mysql connector python versions are affected?
What version fixes CVE-2024-21272?
Is mysql-connector-python affected?
What is the CVSS score of CVE-2024-21272?
What CWE is associated with CVE-2024-21272?
How can I check PyPI dependencies for CVE-2024-21272?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hgjp-83m4-h4fj",
"modified" : "2024-10-24T16:45:37Z",
"published" : "2024-10-15T21:30:39Z",
"aliases" : [ "CVE-2024-21272" ],
"summary" : "MySQL Connector/Python connector takeover vulnerability",
"details" : "Vulnerability in the MySQL Connectors product of Oracle MySQL (component: Connector/Python). Supported versions that are affected are 9.0.0 and prior. Difficult to exploit vulnerability allows low privileged attacker with network access via multiple protocols to compromise MySQL Connectors. Successful attacks of this vulnerability can result in takeover of MySQL Connectors. CVSS 3.1 Base Score 7.5 (Confidentiality, Integrity and Availability impacts). CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "mysql-connector-python"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "9.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21272"
}, {
"type" : "WEB",
"url" : "https://github.com/mysql/mysql-connector-python/commit/e6b927af06e8a85bd3754f602df96a5592b4558c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mysql/mysql-connector-python"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuoct2024.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-10-24T16:45:37Z",
"nvd_published_at" : "2024-10-15T20:15:18Z"
}
}