aiomysql CVE-2025-62611
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker controls rogue MySQL server
-
DeliveryVictim app connects to server
-
ExploitServer sends LOAD_LOCAL packet ignoring client flags
-
Executionaiomysql reads local file without local_infile check
-
ImpactArbitrary client-side file exfiltrated to attacker
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V5 - File Handling File name/path control
|
| Exploitation Conditions | The vulnerable aiomysql client (<= 0.2.0) must initiate a connection to an attacker-controlled or compromised MySQL server. Critically, the flaw triggers even when the client sets local_infile=0 (explicitly disabling local file loading), because prior to 0.3.0 the client never validated its own settings before honoring a server's LOAD_LOCAL request - the fix adds a client-side check that raises RuntimeError when local_infile is false. The limiting factor is therefore not a client configuration toggle but the trust model of the connection: exploitation requires the attacker to control the MySQL endpoint (rogue server, DBaaS/multi-tenant abuse, or man-in-the-middle of an unencrypted/unverified DB connection). Environments that only ever connect to trusted, network-isolated database servers are not realistically exposed. |
| Impact | Signals are consistent and point to a real-but-conditional risk rather than a mass-exploitation emergency. The vendor CVSS 4.0 vector (8.2/High) encodes AV:N, AC:L, PR:N, UI:N but AT:P, meaning no authentication or victim interaction is needed yet a specific attack requirement must hold - the client must connect to an attacker-controlled MySQL server. Impact is confidentiality-only (VC:H, VI:N, VA:N), matching CWE-73 and the advisory's 'arbitrary file read from the client' description. EPSS is low (0.39%, 31st percentile), which aligns with the AT:P precondition: this is not a scan-and-pop internet-wide bug but one requiring a rogue/compromised server in the connection path. There is NO CISA KEV listing (not confirmed actively exploited), but a working PoC against the real rogue_mysql_server tool is published in the GHSA, so publicly available exploit code exists. Net: a genuine priority for any deployment that connects to untrusted, multi-tenant, or potentially-compromised MySQL endpoints (or is exposed to MITM of the DB connection); lower urgency for environments where the database server is fully trusted and network-isolated. No conflicting signals were found between the CVSS vector, description, and source-code evidence. |
| Exploit ScenarioDerived | An attacker stands up a rogue MySQL server that completes a fake authentication handshake and then sends a LOAD_LOCAL instruction packet requesting a chosen path. A victim application using aiomysql <= 0.2.0 connects to that server (e.g., via a poisoned connection string, DNS/MITM redirection, or a malicious DBaaS endpoint) and the client dutifully reads and uploads the requested local file - even with local_infile explicitly set to 0. A public PoC using the rmb122/rogue_mysql_server project is documented in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 08, 2026
Arbitrary client-side file disclosure in aiomysql (pip package, versions <= 0.2.0) allows a rogue or compromised MySQL server to read files from the filesystem of the machine running the aiomysql client. Because the client never validated its own settings before honoring a server-issued LOAD_LOCAL request, a malicious server that emulates a successful handshake can instruct the client to transmit arbitrary local files - and the flaw triggers even when the application explicitly sets local_infile=0. Exploitation is conditional rather than mass-market: the attacker must control or compromise the MySQL endpoint the client connects to (rogue server, compromised DBaaS/tenant, or man-in-the-middle of an unencrypted DB connection), the assessed vector is AV:N/AC:H/PR:N/UI:N with high confidentiality impact only, EPSS is a low 0.39% (31st percentile), no CISA KEV entry exists, and publicly available exploit code is documented in the vendor advisory; a fix shipped in aiomysql 0.3.0.
RemediationAI
Vendor-released patch: upgrade aiomysql to 0.3.0 or later (pip install --upgrade 'aiomysql>=0.3.0'), which adds the client-side guard that raises a RuntimeError instead of transmitting a file when a LOAD_LOCAL packet arrives while local file loading is disabled. Note the behavioral change introduced by the fix: loading local data now requires the explicit local_infile=True connection parameter, and enabling CLIENT.LOCAL_FILES through the generic client_flag argument no longer works - applications that legitimately rely on LOAD DATA LOCAL INFILE must be updated to pass local_infile=True, and after upgrading any code path that issues LOAD DATA LOCAL INFILE without that flag will fail with the new RuntimeError rather than silently reading files, so test data-loading workflows before broad rollout. Where patching is delayed, the practical compensating controls are to treat database endpoints as trusted infrastructure: restrict connections to known, network-isolated MySQL hosts and pin/verify TLS server certificates so an unencrypted or unverified connection cannot be hijacked for man-in-the-middle injection of the rogue-server response (the residual risk is that a legitimately trusted but compromised server can still abuse the feature). Do not rely on setting local_infile=0 as a mitigation on unpatched versions, since the flaw defeats that setting by design; monitoring or blocking outbound connections to unauthorized MySQL endpoints and avoiding credentials and data paths on clients that must reach untrusted database services are the remaining options, each of which limits functionality or adds operational overhead. Advisory and patch references: https://github.com/aio-libs/aiomysql/security/advisories/GHSA-r397-ff8c-wv2g, https://github.com/aio-libs/aiomysql/pull/1044, https://github.com/aio-libs/aiomysql/commit/32c4520dae3711367ded74a4726dcb8bb8919538.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
aiomysql is the asyncio client library for MySQL, built on top of PyMySQL. The underlying mechanism is the MySQL protocol's LOAD DATA LOCAL INFILE feature: when the client advertises the CLIENT_LOCAL_FILES capability flag, a server may respond to a query with a LOCAL INFILE request packet (0xFB) instructing the client to open a named file and stream its contents back over the same connection. That design inherently places the file path under server control, which is the root cause class here - CWE-73 (External Control of File Name or Path). Before 0.3.0, aiomysql checked the client's own local_infile setting only when constructing the connection parameters and never re-validated it when a LOAD_LOCAL packet actually arrived, so a rogue server could simply ignore the negotiated flags and send the request anyway; the same weak path also allowed the capability to be enabled indirectly by passing CLIENT.LOCAL_FILES through the generic client_flag parameter. The fix in commit 32c4520dae3711367ded74a4726dcb8bb8919538 (PR #1044) stores local_infile as an authoritative instance attribute (_local_infile) and raises RuntimeError('Received LOAD_LOCAL packet but local_infile option is false') in _read_ok_packet when a server requests local data while the option is disabled, plus a regression test (test_load_local_disabled) and documentation changes. This port from PyMySQL (commit b5e17cee) mirrors the remediation of the same class of issue previously reported as CVE-2019-2503 for MySQL Connector/J, referenced in the GHSA advisory GHSA-r397-ff8c-wv2g.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Network client with no auth/UI (PR:N/UI:N), but requires victim to connect to an attacker-controlled server so AC:H; file-read yields confidentiality loss only (C:H, I/A:N).
Primary rating from Vendor (github).
CVSS VectorVendor: github
DescriptionCVE.org
aiomysql is a library for accessing a MySQL database from the asyncio. Prior to version 0.3.0, the client-side settings are not checked before sending local files to MySQL server, which allows obtaining arbitrary files from the client using a rogue server. It is possible to create a rogue MySQL server that emulates authorization, ignores client flags and requests arbitrary files from the client by sending a LOAD_LOCAL instruction packet. This issue has been patched in version 0.3.0.
Executive ViewAI
aiomysql, the Python MySQL client library used by many internal applications and data pipelines (versions through 0.2.0), contains a high-severity flaw (CVE-2025-62611) that lets a malicious or compromised database server pull arbitrary files off the machines running the affected application. This means any team whose Python services connect to MySQL through aiomysql - including workloads talking to third-party Database-as-a-Service providers or tenant-shared database instances - could have configuration files, credentials, or data on those hosts disclosed to whoever controls the database endpoint. Although the exploit requires the attacker to control or intercept the database connection rather than being broadly exploitable over the internet, the resulting file disclosure can hand over credentials and secrets that underpin further compromise.
No vendor-released patch identified at time of analysis in the tracked patch data; note the advisory documentation states a fix shipped in aiomysql 0.3.0, so upgrading to that version or later is the preferred remediation. Interim mitigations until the upgrade is complete: enforce TLS with strict server certificate verification for all MySQL connections so a man-in-the-middle cannot impersonate the database; refuse to connect to MySQL endpoints outside trusted, internally controlled infrastructure; segment or restrict workloads that must connect to third-party or shared-tenant DBaaS endpoints; and be aware that setting local_infile=0 on the client does not mitigate this flaw, so application-level configuration changes alone are insufficient.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
NVD
CVE.org
EPSS
GitHub
Exploit-DB