# CVE-2025-24375: MySQL K8s charm could leak credentials for root-level user `serverconfig`

> An unprivileged user can read temporary files to steal root-level database credentials from the MySQL Kubernetes operator.

- **Severity:** Medium 5.0 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 9 Apr 2025
- **Updated:** 10 Apr 2025
- **Also known as:** GHSA-g83v-7694-2hf7

## What is CVE-2025-24375?

CVE-2025-24375 is a medium-severity vulnerability in canonical mysql-k8s-operator, published on 9 Apr 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

Charmed MySQL K8s operator is a Charmed Operator for running MySQL on Kubernetes. Before revision 221, the method for calling a SQL DDL or python based mysql-shell scripts can leak database users credentials. The method mysql-operator calls mysql-shell application rely on writing to a temporary script file containing the full URI, with user and password. The file can be read by a unprivileged user during the operator runtime, due it being created with read permissions (0x644). On other cases, when calling mysql cli, for one specific case when creating the operator users, the DDL contains said users credentials, which can be leak through the same mechanism of a temporary file. All versions prior to revision 221 for kubernetes and revision 338 for machine operators.

Weakness: CWE-256 (Plaintext Storage of a Password)

## Which versions are affected by CVE-2025-24375?


## How do I fix CVE-2025-24375?

No fix has been published for CVE-2025-24375 yet. Limit exposure of the affected software until one is available.

## Is CVE-2025-24375 being exploited?

There is no known exploitation of CVE-2025-24375 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-24375 and fix it if it is affected.

What it is: CVE-2025-24375 is a medium-severity vulnerability in canonical mysql-k8s-operator, published on 9 Apr 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2025-24375 in the wild and no public exploit code.

Affected product: canonical mysql-k8s-operator. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-24375/ (Markdown: https://insights.sbomify.com/CVE-2025-24375/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-24375
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-24375
- OSV: https://osv.dev/vulnerability/CVE-2025-24375

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-24375/
Summaries are generated and may contain mistakes; the official description above is the record.
