XSS Vulnerability in phpMyAdmin: Risk from Crafted SQL File Uploads
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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 →
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.