CVE-2023-35042 — gs-wms
CRITICALCVE-2023-35042 is a critical-severity (CVSS 9.8) remote code execution vulnerability in org.geoserver:gs-wms. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for org.geoserver:gs-wms — see the affected versions and patch details below.
GeoServer RCE due to improper control of generation of code in jai-ext`Jiffle` map algebra language
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2023-35042.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
org.geoserver:gs-wms☕org.geoserver:gs-wfs☕org.geoserver:gs-wms☕org.geoserver:gs-wfs☕org.geoserver:gs-wms☕org.geoserver:gs-wfs☕org.geoserver:gs-wps☕org.geoserver:gs-wps+1 moreReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
GeoServer 2, in some configurations, allows remote attackers to execute arbitrary code via java.lang.Runtime.getRuntime().exec in wps:LiteralData within a wps:Execute request, as exploited in the wild in June 2023.
RCE in Jiffle
The Jiffle map algebra language, provided by jai-ext, allows efficiently execute map algebra over large images. A vulnerability CVE-2022-24816 has been recently found in Jiffle, that allows a Code Injection to be performed by properly crafting a Jiffle invocation.
In the case of GeoServer, the injection can be performed from a remote request.
Assessment
GeoTools includes the Jiffle language as part of the gt-process-raster-<version> module, applications using it should check whether it’s possible to provide a Jiffle script from remote, and if so, upgrade or remove the functionality (see also the GeoServer mitigation, below).
The issue is of particular interest for GeoServer users, as GeoServer embeds Jiffle in the base WAR package. Jiffle is available as a OGC function, for usage in SLD rendering transformations.
This allows for a Remote Code Execution in properly crafted OGC requests, as well as from the administration console, when editing SLD files.
Mitigations
In case you cannot upgrade at once, then the following mitigation is strongly recommended:
- Stop GeoServer
- Open the war file, get into
WEB-INF/liband remove thejanino-<version>.jar - Restart GeoServer.
This effectively removes the Jiffle ability to compile scripts in Java code, from any of the potential attack vectors (Janino is the library used to turn the Java code generated from the Jiffle script, into executable bytecode).
GeoServer should still work properly after the removal, but any attempt to use Jiffle will result in an exception.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.geoserver:gs-wms | all versions | 2.18.6org.geoserver:gs-wms:2.18.6 |
| ☕Maven | org.geoserver:gs-wfs | all versions | 2.18.6org.geoserver:gs-wfs:2.18.6 |
| ☕Maven | org.geoserver:gs-wms | ≥ 2.19.0&&< 2.19.6 | 2.19.6org.geoserver:gs-wms:2.19.6 |
| ☕Maven | org.geoserver:gs-wfs | ≥ 2.19.0&&< 2.19.6 | 2.19.6org.geoserver:gs-wfs:2.19.6 |
| ☕Maven | org.geoserver:gs-wms | ≥ 2.20.0&&< 2.20.4 | 2.20.4org.geoserver:gs-wms:2.20.4 |
| ☕Maven | org.geoserver:gs-wfs | ≥ 2.20.0&&< 2.20.4 | 2.20.4org.geoserver:gs-wfs:2.20.4 |
Affected Products
geoservergeoserverResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.geoserver:gs-wms, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update org.geoserver:gs-wms to 2.18.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2023-35042 is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Frequently Asked Questions
Is CVE-2023-35042 in your dependencies?
Find it across Maven, including transitive dependencies.