CVE-2025-24375

5.0 MEDIUM

📋 TL;DR

The Charmed MySQL K8s operator versions before revision 221 (Kubernetes) and revision 338 (machine operators) create temporary files containing database credentials with overly permissive read permissions (0x644). This allows unprivileged users on the same system to read sensitive database credentials during operator runtime, potentially leading to unauthorized database access.

💻 Affected Systems

Products:
  • Charmed MySQL K8s Operator
  • Charmed MySQL Machine Operator
Versions: All versions prior to revision 221 for Kubernetes operators, prior to revision 338 for machine operators
Operating Systems: Linux
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects deployments where the MySQL operator creates temporary script files during DDL execution or user creation operations.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers gain database administrator credentials, leading to complete database compromise, data theft, data manipulation, or service disruption.

🟠

Likely Case

Malicious users or compromised containers within the Kubernetes cluster read temporary credential files to gain unauthorized database access at the privilege level of leaked credentials.

🟢

If Mitigated

With proper network segmentation and least privilege access controls, impact is limited to the specific Kubernetes namespace or node where the operator runs.

🌐 Internet-Facing: LOW
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires local access to the Kubernetes node or container where the operator runs and ability to read temporary files during credential exposure windows.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Revision 221 for Kubernetes operators, Revision 338 for machine operators

Vendor Advisory: https://github.com/canonical/mysql-k8s-operator/security/advisories/GHSA-g83v-7694-2hf7

Restart Required: Yes

Instructions:

1. Update to revision 221+ for Kubernetes operators or revision 338+ for machine operators. 2. Apply the operator update via your Kubernetes management tool (kubectl, Helm, etc.). 3. Restart the MySQL operator pods to ensure the fix is active.

🔧 Temporary Workarounds

Restrict file permissions on operator containers

linux

Apply stricter file permission controls to prevent unauthorized users from reading temporary files

chmod 600 /tmp/mysql-operator-*
umask 077

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate MySQL operator containers from other workloads
  • Apply Kubernetes Pod Security Standards to restrict container capabilities and filesystem access

🔍 How to Verify

Check if Vulnerable:

Check operator version: kubectl describe pod <mysql-operator-pod> | grep Image. If version is before revision 221 (K8s) or 338 (machine), you are vulnerable.

Check Version:

kubectl describe pod <mysql-operator-pod> | grep Image

Verify Fix Applied:

Verify operator is running revision 221+ (K8s) or 338+ (machine) and check that temporary files created by mysql-shell have restrictive permissions (0x600).

📡 Detection & Monitoring

Log Indicators:

  • Failed authentication attempts using database credentials
  • Unexpected database connections from Kubernetes nodes

Network Indicators:

  • Database connections from unexpected IPs within the Kubernetes cluster

SIEM Query:

source="kubernetes" AND ("mysql-operator" OR "mysql-shell") AND ("temporary file" OR "permission 644")

🔗 References

📤 Share & Export