CVE-2021-29625
📋 TL;DR
This is a cross-site scripting (XSS) vulnerability in Adminer database management software that allows attackers to inject malicious scripts into web pages. It affects Adminer versions 4.6.1 to 4.8.0 when using PDO extensions with MySQL, MariaDB, PostgreSQL, or SQLite. The vulnerability is mitigated by modern browser CSP protections.
💻 Affected Systems
- Adminer
📦 What is this software?
Adminer by Adminer
⚠️ Risk & Real-World Impact
Worst Case
Attackers could steal database credentials, execute arbitrary database queries, or compromise the entire database server if Adminer has high privileges.
Likely Case
Session hijacking, credential theft, or limited database manipulation depending on user permissions.
If Mitigated
Minimal impact when using browsers with strict CSP or proper configuration workarounds.
🎯 Exploit Status
Exploitation requires user interaction (visiting malicious page) and specific PDO configuration. Browser CSP makes exploitation difficult.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 4.8.1
Vendor Advisory: https://github.com/vrana/adminer/security/advisories/GHSA-2v82-5746-vwqc
Restart Required: No
Instructions:
1. Download Adminer 4.8.1 or later from https://www.adminer.org. 2. Replace existing Adminer files with new version. 3. Verify functionality with test connections.
🔧 Temporary Workarounds
Enable Native PHP Extensions
linuxUse native extensions (mysqli, pgsql, sqlite3) instead of PDO extensions
sudo apt-get install php-mysqli php-pgsql php-sqlite3
sudo systemctl restart apache2/php-fpm
Disable PHP Error Display
allPrevent XSS via error messages by disabling display_errors
Edit php.ini: display_errors = Off
Restart web server
🧯 If You Can't Patch
- Use browsers with strict Content Security Policy (CSP) enabled
- Restrict Adminer access to trusted networks only
🔍 How to Verify
Check if Vulnerable:
Check Adminer version in interface footer or source code. If between 4.6.1-4.8.0 and using PDO extensions, you're vulnerable.
Check Version:
grep -r "define.*VERSION" adminer_directory/ or check web interface footer
Verify Fix Applied:
Confirm version shows 4.8.1 or higher in Adminer interface. Test with PDO connections to ensure no XSS occurs.
📡 Detection & Monitoring
Log Indicators:
- Unusual database queries from Adminer interface
- Multiple failed login attempts with script-like patterns
Network Indicators:
- Unexpected JavaScript payloads in Adminer HTTP requests
SIEM Query:
source="web_logs" url="*adminer*" (method="POST" OR method="GET") (content="<script>" OR content="javascript:")
🔗 References
- https://github.com/vrana/adminer/commit/4043092ec2c0de2258d60a99d0c5958637d051a7
- https://github.com/vrana/adminer/security/advisories/GHSA-2v82-5746-vwqc
- https://sourceforge.net/p/adminer/bugs-and-features/797/
- https://github.com/vrana/adminer/commit/4043092ec2c0de2258d60a99d0c5958637d051a7
- https://github.com/vrana/adminer/security/advisories/GHSA-2v82-5746-vwqc
- https://sourceforge.net/p/adminer/bugs-and-features/797/