Moderate: python3 security update - SQL injection in python-pymysql

python3.12-PyMySQL Updated 02 Oct 2025

Summary

02/07/2024
N/A
Yes i
Unrated
Not published

ALSA-2024:4245: Moderate: python3 security update. Affects python3.12-PyMySQL versions < 1.1.0-3.el8_10. Fixed in 1.1.0-3.el8_10. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Python is an interpreted, interactive, object-oriented programming language that supports interfaces to many system calls and libraries. It is widely used for various applications and offers modules, classes, exceptions, and dynamic typing. One of the popular Python packages is python-pymysql, which provides a Python interface for MySQL databases.

Vulnerability Detail

The vulnerability (CVE-2024-36039) in python-pymysql allows for SQL injection if used with untrusted JSON input. This means that an attacker can manipulate JSON data in a way that leads to unauthorized SQL queries being executed against the MySQL database. The impact of this vulnerability can range from unauthorized data access to data manipulation or even complete compromise of the database.

How To Fix

Minimum fixed version

1.1.0-3.el8_10

This is the first release that contains the fix.

sudo dnf update python3.12-PyMySQL

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

Workaround

There is no specific workaround mentioned for this vulnerability. However, as a general best practice, it is recommended to validate and sanitize all user inputs, including JSON data, before using them in SQL queries. This can help mitigate the risk of SQL injection attacks.

Conclusion

In conclusion, the python-pymysql package is vulnerable to SQL injection if used with untrusted JSON input. This can lead to unauthorized SQL queries and potential compromise of the MySQL database. It is recommended to update the package to the latest version and follow best practices for input validation and sanitization to mitigate the risk of SQL injection attacks.

See every vulnerability recorded for python3.12-PyMySQL →

Share this vulnerability

FAQ

The impact of this vulnerability can range from unauthorized data access to data manipulation or even complete compromise of the MySQL database.

You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities without requiring access to the code or installation.

Yes, a fix is available for this vulnerability. It is recommended to update the python-pymysql package to version 1.1.0-3.el8_10 or later.

There are no known exploits for this vulnerability at the moment. However, it is important to apply the recommended fix to prevent any potential exploitation.

To mitigate the risk of SQL injection attacks, it is important to validate and sanitize all user inputs, including JSON data, before using them in SQL queries. Additionally, keeping all software and packages up to date with the latest security patches is crucial.

Related vulnerabilities

Recent vulnerabilities recorded for python3.12-PyMySQL.

How To Fix

Minimum fixed version

1.1.0-3.el8_10

This is the first release that contains the fix.

sudo dnf update python3.12-PyMySQL

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