CVE-2021-21311
📋 TL;DR
CVE-2021-21311 is a server-side request forgery (SSRF) vulnerability in Adminer database management software that allows attackers to make unauthorized requests from the vulnerable server to internal systems. Users of Adminer versions 4.0.0 through 4.7.8 who use the bundled driver version (adminer.php) are affected. This could lead to internal network reconnaissance and potential data exposure.
💻 Affected Systems
- Adminer
📦 What is this software?
Adminer by Adminer
⚠️ Risk & Real-World Impact
Worst Case
Attackers could access internal services, databases, or cloud metadata endpoints, potentially leading to data exfiltration, privilege escalation, or lateral movement within the network.
Likely Case
Internal network scanning, accessing internal APIs or services, and potentially retrieving sensitive information from cloud metadata services.
If Mitigated
Limited impact if network segmentation prevents access to sensitive internal services and proper input validation is implemented.
🎯 Exploit Status
Exploitation requires authenticated access to Adminer. The vulnerability is in the driver selection functionality where user input is not properly validated.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 4.7.9
Vendor Advisory: https://github.com/vrana/adminer/security/advisories/GHSA-x5r2-hj5c-8jx6
Restart Required: No
Instructions:
1. Download Adminer 4.7.9 or later from the official repository. 2. Replace the existing adminer.php file with the patched version. 3. Verify the version in the Adminer interface.
🔧 Temporary Workarounds
Use standalone driver version
allSwitch from the bundled adminer.php to individual driver files which are not affected by this vulnerability.
Download individual driver files from https://www.adminer.org/
Network segmentation
allRestrict Adminer server's outbound network access to prevent SSRF attacks from reaching internal services.
Configure firewall rules to block outbound connections from Adminer server to internal networks
🧯 If You Can't Patch
- Restrict Adminer access to trusted IP addresses only
- Implement web application firewall rules to detect and block SSRF patterns
🔍 How to Verify
Check if Vulnerable:
Check Adminer version in the interface or examine the adminer.php file header for version information.
Check Version:
grep -i 'version' adminer.php | head -1
Verify Fix Applied:
Verify the version shows 4.7.9 or higher in the Adminer interface or check the file modification date.
📡 Detection & Monitoring
Log Indicators:
- Unusual driver selection attempts
- Requests to internal IP addresses from Adminer server
- Multiple failed connection attempts to various internal services
Network Indicators:
- Outbound connections from Adminer server to internal services not typically accessed
- Requests to cloud metadata endpoints (169.254.169.254, etc.)
SIEM Query:
source="adminer_access.log" AND (uri="/?driver=" OR uri="/?server=") AND NOT (src_ip IN trusted_ips)
🔗 References
- https://github.com/vrana/adminer/commit/ccd2374b0b12bd547417bf0dacdf153826c83351
- https://github.com/vrana/adminer/files/5957311/Adminer.SSRF.pdf
- https://github.com/vrana/adminer/security/advisories/GHSA-x5r2-hj5c-8jx6
- https://lists.debian.org/debian-lts-announce/2021/03/msg00002.html
- https://packagist.org/packages/vrana/adminer
- https://github.com/vrana/adminer/commit/ccd2374b0b12bd547417bf0dacdf153826c83351
- https://github.com/vrana/adminer/files/5957311/Adminer.SSRF.pdf
- https://github.com/vrana/adminer/security/advisories/GHSA-x5r2-hj5c-8jx6
- https://lists.debian.org/debian-lts-announce/2021/03/msg00002.html
- https://packagist.org/packages/vrana/adminer
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-21311