CVE-2021-40822
📋 TL;DR
This CVE describes a Server-Side Request Forgery (SSRF) vulnerability in GeoServer that allows attackers to make arbitrary HTTP requests from the vulnerable server. Attackers can exploit the proxy host configuration option to access internal network resources or interact with local services. All GeoServer instances up to version 2.18.5 and 2.19.x up to 2.19.2 are affected.
💻 Affected Systems
- GeoServer
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete compromise of internal network resources, data exfiltration from internal services, or use as a pivot point for further attacks on internal systems.
Likely Case
Unauthorized access to internal HTTP services, information disclosure from internal endpoints, or interaction with cloud metadata services.
If Mitigated
Limited to external network access only, with no sensitive internal services exposed to the vulnerable server.
🎯 Exploit Status
SSRF vulnerabilities are commonly exploited and require minimal technical skill. The proxy host parameter can be manipulated to make arbitrary requests.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.19.3 and 2.18.6
Vendor Advisory: https://github.com/geoserver/geoserver/releases
Restart Required: Yes
Instructions:
1. Backup your GeoServer configuration and data. 2. Download GeoServer 2.19.3 or 2.18.6 from the official releases. 3. Stop the GeoServer service. 4. Replace the existing installation with the patched version. 5. Restore your configuration and data. 6. Start the GeoServer service.
🔧 Temporary Workarounds
Disable Proxy Host Configuration
allRemove or restrict access to proxy host configuration options in GeoServer settings
Network Segmentation
allPlace GeoServer in a restricted network segment with limited outbound access
🧯 If You Can't Patch
- Implement strict network egress filtering to limit GeoServer's outbound HTTP requests
- Deploy a web application firewall (WAF) with SSRF protection rules
🔍 How to Verify
Check if Vulnerable:
Check GeoServer version via web interface or by examining the installation directory. Versions 2.18.5 or lower, or 2.19.0 through 2.19.2 are vulnerable.
Check Version:
Check the GeoServer web interface at /geoserver/web/ or examine the version.txt file in the installation directory.
Verify Fix Applied:
Verify version is 2.19.3 or higher, or 2.18.6 or higher. Test proxy functionality with controlled endpoints to ensure SSRF is prevented.
📡 Detection & Monitoring
Log Indicators:
- Unusual outbound HTTP requests from GeoServer
- Requests to internal IP addresses or localhost
- Multiple failed proxy connection attempts
Network Indicators:
- GeoServer making unexpected HTTP requests to internal services
- Traffic to cloud metadata endpoints (169.254.169.254)
SIEM Query:
source="geoserver" AND (dest_ip=10.0.0.0/8 OR dest_ip=172.16.0.0/12 OR dest_ip=192.168.0.0/16 OR dest_ip=127.0.0.1 OR dest_ip=169.254.169.254)
🔗 References
- https://github.com/geoserver/geoserver/compare/2.19.2...2.19.3
- https://github.com/geoserver/geoserver/releases
- https://osgeo-org.atlassian.net/browse/GEOS-10229
- https://osgeo-org.atlassian.net/browse/GEOS-10229?focusedCommentId=83508
- https://github.com/geoserver/geoserver/compare/2.19.2...2.19.3
- https://github.com/geoserver/geoserver/releases
- https://osgeo-org.atlassian.net/browse/GEOS-10229
- https://osgeo-org.atlassian.net/browse/GEOS-10229?focusedCommentId=83508