XSS Vulnerability in phpMyAdmin: Risk from Crafted SQL File Uploads

phpmyadmin Updated 02 Oct 2025

Summary

13/02/2023
N/A
Yes i
Medium
5.4

CVE-2023-25727: In phpMyAdmin before 4.9.11 and 5.x before 5.2.1, an authenticated user can trigger XSS by uploading a crafted .sql file through the drag-and-drop interface. Affects phpmyadmin across 2 version ranges.

< 4:5.0.4+dfsg2-2+deb11u2 < eca95233a1bffc93d4636a0b42acc9db835976af

Fixed in 4:5.0.4+dfsg2-2+deb11u2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

phpMyAdmin is a widely-used open-source tool for managing MySQL databases through a web interface. It provides features such as database management, user management, and data import/export capabilities. However, versions prior to 4.9.11 and 5.x before 5.2.1 are vulnerable to an XSS (Cross-Site Scripting) attack, which can be triggered by authenticated users uploading malicious .sql files via the drag-and-drop interface.

Vulnerability Detail

The vulnerability arises from improper handling of uploaded .sql files, allowing an authenticated user to execute scripts that can manipulate the web application's behavior. This can lead to unauthorized actions, data leakage, or session hijacking. The vulnerability is classified with a CVSS score of 5.4, indicating a moderate risk level. Attackers can exploit this flaw to inject malicious scripts into the application, affecting both the application and its users.

How To Fix

Minimum fixed version

4:5.0.4+dfsg2-2+deb11u2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade phpmyadmin

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary measure, users can restrict file uploads to only trusted users and implement strict validation on the uploaded files to prevent the execution of potentially harmful scripts. Additionally, disabling the drag-and-drop upload feature can reduce the risk until an upgrade is performed.

Conclusion

The XSS vulnerability in phpMyAdmin poses a significant risk to users, particularly those using affected versions. It is crucial to upgrade to the latest versions to safeguard against potential exploits. Implementing workarounds can provide temporary relief, but a permanent fix through an upgrade is strongly recommended.

See every vulnerability recorded for phpmyadmin →

Share this vulnerability

FAQ

The vulnerability allows authenticated users to upload malicious .sql files that can execute harmful scripts, leading to XSS attacks.

Versions before 4.9.11 and 5.x before 5.2.1 are vulnerable to this issue.

You can use Vulert, which monitors open-source vulnerabilities in your software using a manifest file like package-lock.json. Visit Vulert Scanner to check your application without signup.

Implement strict file upload validations and restrict access to the upload feature as a temporary workaround.

The CVSS score of this vulnerability is 5.4, indicating a moderate risk level.

Related vulnerabilities

Recent vulnerabilities recorded for phpmyadmin.

How To Fix

Minimum fixed version

4:5.0.4+dfsg2-2+deb11u2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade phpmyadmin

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback