CVE-2021-27905
📋 TL;DR
CVE-2021-27905 is a Server-Side Request Forgery (SSRF) vulnerability in Apache Solr's ReplicationHandler that allows attackers to make arbitrary HTTP requests from the Solr server. This can lead to internal network reconnaissance, data exfiltration, or chaining with other vulnerabilities. All Apache Solr versions before 8.8.2 are affected.
💻 Affected Systems
- Apache Solr
📦 What is this software?
Solr by Apache
⚠️ Risk & Real-World Impact
Worst Case
Full compromise of the Solr server leading to internal network pivoting, data theft, and potential remote code execution through chained vulnerabilities.
Likely Case
Internal network reconnaissance, data exfiltration from internal services, and potential denial of service through resource exhaustion.
If Mitigated
Limited impact if proper network segmentation and access controls prevent the Solr server from reaching sensitive internal resources.
🎯 Exploit Status
Exploitation requires sending crafted requests to the ReplicationHandler endpoint. No authentication is required by default.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 8.8.2
Vendor Advisory: https://lists.apache.org/thread.html/r0ddc3a82bd7523b1453cb7a5e09eb5559517145425074a42eb326b10%40%3Cannounce.apache.org%3E
Restart Required: Yes
Instructions:
1. Download Apache Solr 8.8.2 or later from the official website. 2. Backup your current Solr installation and data. 3. Stop the Solr service. 4. Replace the Solr installation with the patched version. 5. Restart the Solr service. 6. Verify the version is 8.8.2 or higher.
🔧 Temporary Workarounds
Disable ReplicationHandler
allRemove or disable the ReplicationHandler endpoint if not required for your deployment.
Edit solrconfig.xml and remove or comment out the <requestHandler name="/replication" class="solr.ReplicationHandler" /> section
Network Access Control
linuxRestrict network access to the Solr ReplicationHandler endpoint using firewall rules.
iptables -A INPUT -p tcp --dport 8983 -s trusted_ip -j ACCEPT
iptables -A INPUT -p tcp --dport 8983 -j DROP
🧯 If You Can't Patch
- Implement strict network segmentation to prevent the Solr server from accessing sensitive internal resources.
- Deploy a web application firewall (WAF) with SSRF protection rules to block malicious requests.
🔍 How to Verify
Check if Vulnerable:
Check if Solr version is below 8.8.2 and if the ReplicationHandler endpoint is accessible at /solr/core_name/replication.
Check Version:
curl http://solr_host:8983/solr/admin/info/system | grep -o '"solr-spec-version":"[^"]*"'
Verify Fix Applied:
Verify Solr version is 8.8.2 or higher and test that SSRF attempts via the masterUrl parameter are blocked.
📡 Detection & Monitoring
Log Indicators:
- Unusual requests to /replication endpoint with external URLs in parameters
- HTTP requests originating from Solr server to unexpected internal services
Network Indicators:
- Outbound HTTP requests from Solr server to internal IP ranges not typically accessed
- Traffic patterns suggesting port scanning from the Solr server
SIEM Query:
source="solr.log" AND (url="/replication" AND (param="masterUrl" OR param="leaderUrl")) AND NOT dest_ip IN allowed_ips
🔗 References
- https://lists.apache.org/thread.html/r0ddc3a82bd7523b1453cb7a5e09eb5559517145425074a42eb326b10%40%3Cannounce.apache.org%3E
- https://lists.apache.org/thread.html/r140128dc6bb4f4e0b6a39e962c7ca25a8cbc8e48ed766176c931fccc%40%3Cusers.solr.apache.org%3E
- https://lists.apache.org/thread.html/r3da74965aba2b5f5744b7289ad447306eeb2940c872801819faa9314%40%3Cusers.solr.apache.org%3E
- https://lists.apache.org/thread.html/r6ccec7fc54d82591b23c143f1f6a6e38f6e03e75db70870e4cb14a1a%40%3Ccommits.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/r720a4a0497fc90bad5feec8aa18b777912ee15c7eeb5f882adbf523e%40%3Ccommits.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/r78a3a4f1138a1608b0c6d4a2ee7647848c1a20b0d5c652cd9b02c25a%40%3Ccommits.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/r8f1152a43c36d878bbeb5a92f261e9efaf3af313b033d7acfccea59d%40%3Cnotifications.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/r95df34bb158375948da82b4dfe9a1b5d528572d586584162f8f5aeef%40%3Cusers.solr.apache.org%3E
- https://lists.apache.org/thread.html/rae9ccaecce9859f709ed1458545d90a4c07163070dc98b5e9e59057f%40%3Cnotifications.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/rd232d77c57a8ce172359ab098df9512d8b37373ab87c444be911b430%40%3Cnotifications.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/re9d64bb8e5dfefddcbf255adb4559e13a0df5b818da1b9b51329723f%40%3Cnotifications.ofbiz.apache.org%3E
- https://security.netapp.com/advisory/ntap-20210611-0009/
- https://lists.apache.org/thread.html/r0ddc3a82bd7523b1453cb7a5e09eb5559517145425074a42eb326b10%40%3Cannounce.apache.org%3E
- https://lists.apache.org/thread.html/r140128dc6bb4f4e0b6a39e962c7ca25a8cbc8e48ed766176c931fccc%40%3Cusers.solr.apache.org%3E
- https://lists.apache.org/thread.html/r3da74965aba2b5f5744b7289ad447306eeb2940c872801819faa9314%40%3Cusers.solr.apache.org%3E
- https://lists.apache.org/thread.html/r6ccec7fc54d82591b23c143f1f6a6e38f6e03e75db70870e4cb14a1a%40%3Ccommits.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/r720a4a0497fc90bad5feec8aa18b777912ee15c7eeb5f882adbf523e%40%3Ccommits.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/r78a3a4f1138a1608b0c6d4a2ee7647848c1a20b0d5c652cd9b02c25a%40%3Ccommits.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/r8f1152a43c36d878bbeb5a92f261e9efaf3af313b033d7acfccea59d%40%3Cnotifications.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/r95df34bb158375948da82b4dfe9a1b5d528572d586584162f8f5aeef%40%3Cusers.solr.apache.org%3E
- https://lists.apache.org/thread.html/rae9ccaecce9859f709ed1458545d90a4c07163070dc98b5e9e59057f%40%3Cnotifications.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/rd232d77c57a8ce172359ab098df9512d8b37373ab87c444be911b430%40%3Cnotifications.ofbiz.apache.org%3E
- https://lists.apache.org/thread.html/re9d64bb8e5dfefddcbf255adb4559e13a0df5b818da1b9b51329723f%40%3Cnotifications.ofbiz.apache.org%3E
- https://security.netapp.com/advisory/ntap-20210611-0009/