VAITP Dataset

← Back to the dataset

CVE-2024-21170

MySQL Connectors vulnerability allows unauthorized data access and partial DOS.

  • CVSS 6.3
  • CWE-200
  • Authentication, Authorization, and Session Management
  • Remote

Vulnerability in the MySQL Connectors product of Oracle MySQL (component: Connector/Python). Supported versions that are affected are 8.4.0 and prior. Easily exploitable vulnerability allows low privileged attacker with network access via multiple protocols to compromise MySQL Connectors. Successful attacks of this vulnerability can result in unauthorized update, insert or delete access to some of MySQL Connectors accessible data as well as unauthorized read access to a subset of MySQL Connectors accessible data and unauthorized ability to cause a partial denial of service (partial DOS) of MySQL Connectors. CVSS 3.1 Base Score 6.3 (Confidentiality, Integrity and Availability impacts). CVSS Vector: (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L).

CVSS base score
6.3
Published
2024-07-16
OWASP
A05 Security Misconfiguration
Orthogonal defect classification
Interface
Code defect classification
Incorrect Interface
Category
Authentication, Authorization, and Session Management
Subcategory
Insecure Authentication Mechanisms
Accessibility scope
Remote
Impact
Unauthorized Access
Affected component
Connector/Py
Fixed by upgrading
Yes

Solution

Upgrade to MySQL Connector/Python version 8.4.1 or later.

Vulnerable code sample

import mysql.connector

connection = mysql.connector.connect(
    host='localhost',
    user='your_username',
    password='your_password',
    database='your_database'
)

try:
    cursor = connection.cursor()
    user_input = "some_value'; DROP TABLE your_table; --"
    cursor.execute(f"SELECT * FROM your_table WHERE condition = '{user_input}'")
    results = cursor.fetchall()
    for row in results:
        print(row)
except mysql.connector.Error as err:
    print(f"Error: {err}")
finally:
    cursor.close()
    connection.close()

Patched code sample

import mysql.connector

connection = mysql.connector.connect(
    host='localhost',
    user='your_username',
    password='your_password',
    database='your_database',
    allow_unicode=True
)

try:
    cursor = connection.cursor()
    user_input = "some_value'; DROP TABLE your_table; --"
    cursor.execute(f"SELECT * FROM your_table WHERE condition = '{user_input}'")
    results = cursor.fetchall()
    for row in results:
        print(row)
except mysql.connector.Error as err:
    print(f"Error: {err}")
finally:
    cursor.close()
    connection.close()

Payload

'; DROP TABLE users; --

Cite this entry

@misc{vaitp:cve202421170,
  title        = {{MySQL Connectors vulnerability allows unauthorized data access and partial DOS.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2024},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2024-21170},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-21170/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::