CVE-2023-35042

CVE-2023-35042 is a critical-severity security vulnerability in org.geoserver:gs-wms (maven), affecting versions < 2.18.6. It is fixed in 2.18.6, 2.19.6, 2.20.4.

Summary

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:

  1. Stop GeoServer
  2. Open the war file, get into WEB-INF/lib and remove the janino-<version>.jar
  3. 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.

Impact

CVE-2023-35042 has a CVSS score of 9.8 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.18.6, 2.19.6, 2.20.4); upgrading removes the vulnerable code path.

Affected versions

org.geoserver:gs-wms (< 2.18.6) org.geoserver:gs-wfs (< 2.18.6) org.geoserver:gs-wms (>= 2.19.0, < 2.19.6) org.geoserver:gs-wfs (>= 2.19.0, < 2.19.6) org.geoserver:gs-wms (>= 2.20.0, < 2.20.4) org.geoserver:gs-wfs (>= 2.20.0, < 2.20.4) org.geoserver:gs-wps (< 2.18.6) org.geoserver:gs-wps (>= 2.19.0, < 2.19.6) org.geoserver:gs-wps (>= 2.20.0, < 2.20.4)

Security releases

org.geoserver:gs-wms → 2.18.6 (maven) org.geoserver:gs-wfs → 2.18.6 (maven) org.geoserver:gs-wms → 2.19.6 (maven) org.geoserver:gs-wfs → 2.19.6 (maven) org.geoserver:gs-wms → 2.20.4 (maven) org.geoserver:gs-wfs → 2.20.4 (maven) org.geoserver:gs-wps → 2.18.6 (maven) org.geoserver:gs-wps → 2.19.6 (maven) org.geoserver:gs-wps → 2.20.4 (maven)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade the following packages to resolve this vulnerability:

org.geoserver:gs-wms to 2.18.6 or later; org.geoserver:gs-wfs to 2.18.6 or later; org.geoserver:gs-wms to 2.19.6 or later; org.geoserver:gs-wfs to 2.19.6 or later; org.geoserver:gs-wms to 2.20.4 or later; org.geoserver:gs-wfs to 2.20.4 or later; org.geoserver:gs-wps to 2.18.6 or later; org.geoserver:gs-wps to 2.19.6 or later; org.geoserver:gs-wps to 2.20.4 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2023-35042? CVE-2023-35042 is a critical-severity security vulnerability in org.geoserver:gs-wms (maven), affecting versions < 2.18.6. It is fixed in 2.18.6, 2.19.6, 2.20.4.
  2. How severe is CVE-2023-35042? CVE-2023-35042 has a CVSS score of 9.8 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by CVE-2023-35042?
    • org.geoserver:gs-wms (maven) (versions < 2.18.6)
    • org.geoserver:gs-wfs (maven) (versions < 2.18.6)
    • org.geoserver:gs-wps (maven) (versions < 2.18.6)
  4. Is there a fix for CVE-2023-35042? Yes. CVE-2023-35042 is fixed in 2.18.6, 2.19.6, 2.20.4. Upgrade to this version or later.
  5. Is CVE-2023-35042 exploitable, and should I be worried? Whether CVE-2023-35042 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2023-35042 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2023-35042?
    • Upgrade org.geoserver:gs-wms to 2.18.6 or later
    • Upgrade org.geoserver:gs-wfs to 2.18.6 or later
    • Upgrade org.geoserver:gs-wms to 2.19.6 or later
    • Upgrade org.geoserver:gs-wfs to 2.19.6 or later
    • Upgrade org.geoserver:gs-wms to 2.20.4 or later
    • Upgrade org.geoserver:gs-wfs to 2.20.4 or later
    • Upgrade org.geoserver:gs-wps to 2.18.6 or later
    • Upgrade org.geoserver:gs-wps to 2.19.6 or later
    • Upgrade org.geoserver:gs-wps to 2.20.4 or later

Other vulnerabilities in org.geoserver:gs-wms

Other vulnerabilities in org.geoserver:gs-wms

Stop the waste.
Protect your environment with Kodem.