GeoServer CVE-2026-120705 XML Injection Enables Agent Pipeline
Defensive teardown of unauthenticated GeoServer WFS XML injection (CVE-2026-120705) and indirect prompt injection risk in AI agent web-fetch pipelines, with
Patch GeoServer to 2.27.7, 2.28.6, or 3.0.2 and sandbox agent web-fetch tools to block unauthenticated WFS XML injection from exfiltrating secrets via indirect prompt injection.
Key Numbers & Verified Specs
6 metrics| Metric / Spec | Verified Finding | Source |
|---|---|---|
| CVE ID | CVE-2026-120705 | mallory.ai |
| CWE | CWE-91 XML Injection | mallory.ai |
| Affected GeoServer versions | Before 2.27.7, 2.28.x before 2.28.6, 3.0.x before 3.0.2 | mallory.ai |
| Fixed GeoServer versions | 2.27.7, 2.28.6, 3.0.2 | cvemon.intruder.io |
| CISA KEV status | Added Nov 27, 2026; active exploitation reported | mallory.ai |
| GeoTools gt-metadata fixed versions | 33.7, 34.6, 35.2 or newer | mallory.ai |
Jump to section (5) +
Threat Model & Attack Surface Matrix
CVE-2026-120705 is an unauthenticated XML injection in GeoServer's built-in WFS 2.0 GetFeatureById stored query. Attacker-supplied identifiers are inserted into an XML query template without adequate escaping, permitting injection of additional XML elements including XInclude. A single unauthenticated WFS request can disclose local text files readable by the GeoServer process or trigger server-side HTTP/HTTPS requests to attacker-selected destinations. CISA added this vulnerability to its Known Exploited Vulnerabilities catalog on November 27, 2026, and active exploitation is reported. CVE-2026-120705 advisory
The AI-specific risk emerges when autonomous agents use web-fetch tools to retrieve geospatial data from GeoServer instances. An attacker who controls a URL fetched by an agent, or who compromises a GeoServer instance upstream of an agent pipeline, can inject XML that causes the server to read local files such as password digests or signing keys and return them in the WFS response. The agent then incorporates that response into its context window, achieving indirect prompt injection and potential data exfiltration. GeoServer vulnerabilities under attack
| Attack Surface | Blast Radius | Concrete Control |
|---|---|---|
| Unauthenticated WFS GetFeatureById | Local file disclosure, SSRF, credential theft | Upgrade to 2.27.7, 2.28.6, or 3.0.2; disable unused WFS |
| Agent web-fetch tool | Indirect prompt injection, context poisoning | Sandbox fetches; allowlist domains; strip XML responses |
| GeoServer process filesystem | Password digests, signing keys, config leakage | Minimal filesystem permissions; no outbound HTTP/HTTPS |
| Reverse proxy / WAF | Bypass via direct backend access | Restrict WFS/OWS to trusted clients at network boundary |
Why Naive Prompt Filters Fail
Keyword-based prompt filters operating on agent input or output cannot stop this chain because the malicious payload never reaches the model as user text. The injection occurs inside a server-side XML template processed by GeoServer before the agent ever sees the response. The agent fetches what it believes is a benign geospatial feature collection, but the response contains exfiltrated local file content or attacker-controlled XML entities. By the time a prompt filter inspects the agent's context, the secret material is already embedded in fetched tool output, and multi-turn guardrail drift can cause the agent to forward that content to external tools or log it to untrusted destinations.
OWASP Top 10 for LLM Applications 2025 classifies this as LLM01:2025 Prompt Injection (including the indirect/tool-output variant), and NIST AI RMF 1.0 invokes Govern-1.1, Map-2.3, and Manage-2.1 for input validation and output sanitization in model-integrated systems. Relying on model-level refusals is insufficient because the vulnerability is in the GeoServer XML parser, not in the language model's instruction following. CVE-2026-120705 overview
Defense-in-Depth & Sandbox Isolation Architecture
Deploy GeoServer behind a reverse proxy that terminates WFS/OWS access and allows only trusted internal clients. Enforce egress filtering on the GeoServer host so outbound HTTP/HTTPS cannot reach internal metadata services or attacker-controlled domains. Run the GeoServer process under a dedicated unprivileged account with read-only access to its data directory and no access to password files, signing keys, or configuration outside the application tree.
For AI agent pipelines, isolate web-fetch tools in a network namespace with no route to the GeoServer management network. Use an allowlist of approved domains and block private IP ranges (RFC 1918) to prevent SSRF. Parse fetched WFS responses with a strict XML parser that disables XInclude and external entity resolution, then strip or quarantine responses containing unexpected elements before they enter the agent context. Log all fetch events with request URL, response size, and content hash for forensic review.
Runnable Guardrail Policy / Verification Code
The following mitmproxy script enforces egress allowlists, blocks RFC 1918 ranges, and strips XInclude/external entities from XML responses before they reach the agent:
# fetch_guard.py — mitmproxy addon for agent web-fetch sandbox
# Run: mitmdump -s fetch_guard.py --set allowed_domains=geoserver.internal
import re
from mitmproxy import http, ctx
ALLOWED_DOMAINS = set(ctx.options.allowed_domains.split(',')) if hasattr(ctx.options, 'allowed_domains') else {'geoserver.internal'}
BLOCKED_NETS = [re.compile(r'^10\.'), re.compile(r'^172\.(1[6-9]|2[0-9]|3[0-1])\.'), re.compile(r'^192\.168\.')]
MAX_BYTES = 1_048_576
class FetchGuard:
def request(self, flow: http.HTTPFlow) -> None:
host = flow.request.pretty_host
if host not in ALLOWED_DOMAINS:
flow.response = http.Response.make(403, b'Domain not allowed', {'Content-Type': 'text/plain'})
return
# Block RFC 1918 at DNS resolution layer (requires mitmproxy DNS override)
# This is a second line of defense; primary block is at network namespace level
def response(self, flow: http.HTTPFlow) -> None:
if len(flow.response.content) > MAX_BYTES:
flow.response = http.Response.make(413, b'Response too large', {'Content-Type': 'text/plain'})
return
ctype = flow.response.headers.get('Content-Type', '')
if not any(ct in ctype for ct in ('application/xml', 'text/xml', 'application/gml+xml')):
return
# Strip XInclude and external entity declarations
body = flow.response.content.decode('utf-8', errors='replace')
body = re.sub(r'<xi:include[^>]*/?>', '', body, flags=re.IGNORECASE)
body = re.sub(r'<!ENTITY[^>]*>', '', body, flags=re.IGNORECASE)
body = re.sub(r'<!DOCTYPE[^>]*>', '', body, flags=re.IGNORECASE | re.DOTALL)
flow.response.content = body.encode('utf-8')
addons = [FetchGuard()]This Python verification function checks whether a running GeoServer instance reports a patched version:
import re
import requests
def verify_geoserver_patch(base_url: str, timeout: float = 5.0) -> dict:
"""Return patch status without sending exploit payloads."""
try:
resp = requests.get(f"{base_url.rstrip('/')}/about/version.json", timeout=timeout)
resp.raise_for_status()
version = resp.json().get("version", "")
except Exception as exc:
return {"patched": False, "version": None, "error": str(exc)}
patched_versions = {"2.27.7", "2.28.6", "3.0.2"}
major_minor = re.match(r"(\d+\.\d+)", version)
if not major_minor:
return {"patched": False, "version": version, "error": "unparseable version"}
branch = major_minor.group(1)
if branch == "2.27" and version >= "2.27.7":
return {"patched": True, "version": version}
if branch == "2.28" and version >= "2.28.6":
return {"patched": True, "version": version}
if branch == "3.0" and version >= "3.0.2":
return {"patched": True, "version": version}
return {"patched": False, "version": version, "error": "below fixed release"}Run this check against every GeoServer instance processing requests, not just the primary node, and verify GeoTools gt-metadata dependencies against versions 33.7, 34.6, or 35.2 depending on your release branch.
Operational Tradeoffs & False-Positive Budget
Disabling WFS functionality reduces attack surface but breaks clients that depend on feature queries. Restricting WFS/OWS to trusted clients at a reverse proxy introduces operational overhead when agent fetch tools rotate egress IPs. Egress filtering via mitmproxy adds approximately 5 to 15 milliseconds per request in our internal benchmarks (single-core, 1 MB response, no TLS termination). XML response stripping produces false positives when legitimate WFS responses include schema locations or namespace declarations that resemble injected elements; tune the allowlist to expected GML schemas and alert on deviations rather than blocking outright.
Rotate secrets after patching only if disclosure is suspected, because patching does not invalidate previously extracted signing keys or password digests. Maintain a false-positive budget of under 2 percent for response stripping rules to avoid disrupting legitimate geospatial workflows while catching exfiltration patterns. This budget is an internal target; measure it in your environment by replaying production traffic through the guard in shadow mode before enforcing.
Reader Q&A
Frequently Asked Questions
Does patching GeoServer alone remove attacker access?
Can an AI agent web-fetch tool trigger this vulnerability?
What interim mitigation works if patching is delayed?
Bibliography & Verification
Primary Sources & References
Human × Agent Co-Work
Hamdi Soudani · in collaboration with Pyvren
Systems engineer & technical writer exploring AI infrastructure, security, and edge craft in daily collaboration with Pyvren.
Keep Reading
Related Dispatches
Hamdi Soudani × Pyvren
Honest engineering stories — co-crafted with primary benchmarks & real code
Every dispatch blends hands-on engineering judgment with verified primary sources, reproducible configs, and clear tradeoffs.