Bug 2282821 (CVE-2024-36039)

Summary: CVE-2024-36039 python-pymysql: SQL injection if used with untrusted JSON input
Product: [Other] Security Response Reporter: TEJ RATHI <trathi>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bdettelb, hhorak, jorton, kaycoth, kholdawa, python-maint
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pymysql 1.1.1 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in PyMySQL. When processing untrusted JSON input, keys are not escaped by the escape_dict function due to insufficient input sanitization, allowing an attacker to inject malicious SQL queries.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2282822, 2282823, 2292655    
Bug Blocks: 2282826    

Description TEJ RATHI 2024-05-23 05:06:44 UTC
PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Reference:
https://github.com/advisories/GHSA-v9hf-5j83-6xpp

Upstream patch:
https://github.com/PyMySQL/PyMySQL/commit/521e40050cb386a499f68f483fefd144c493053c

Comment 1 TEJ RATHI 2024-05-23 05:09:19 UTC
Created python-PyMySQL tracking bugs for this issue:

Affects: fedora-all [bug 2282822]

Comment 10 Guilherme de Almeida Suckevicz 2024-06-17 13:56:13 UTC
Created python-PyMySQL tracking bugs for this issue:

Affects: epel-7 [bug 2292655]

Comment 11 errata-xmlrpc 2024-07-02 15:24:22 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:4244 https://access.redhat.com/errata/RHSA-2024:4244

Comment 12 errata-xmlrpc 2024-07-02 15:24:27 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:4245 https://access.redhat.com/errata/RHSA-2024:4245