Skip to main content

aiomysql CVE-2025-62611

HIGH
External Control of File Name or Path (CWE-73)
2025-10-22 security-advisories@github.com
8.2
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker controls rogue MySQL server
  2. Delivery
    Victim app connects to server
  3. Exploit
    Server sends LOAD_LOCAL packet ignoring client flags
  4. Execution
    aiomysql reads local file without local_infile check
  5. Impact
    Arbitrary 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

pypi aiomysql fix: 0.3.0

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

Vendor (github) PRIMARY 8.2 HIGH
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
vuln.today AI 5.9 MEDIUM

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).

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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

Why It Matters

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.

Business Impact: Medium
Compensating Controls

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

EPSS Score
0.4%
Top 69% exploitable
Prevalence
Medium
popular Python asyncio MySQL client library, common but not ubiquitous
Data Quality
4 sources
Confidence: Medium

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Medium

Priority Score

41
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +41
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

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

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy