CVE-2023-35042: Code Injection

Published Jun 12, 2023
·
Updated

DISPUTED 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. NOTE: the vendor states that they are unable to reproduce this in any version.

Other sources

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.

Affected Software

10 affected componentsFixes available
maven/org.geoserver:gs-wps>=2.20.0<2.20.4
2.20.4
maven/org.geoserver:gs-wps>=2.19.0<2.19.6
2.19.6
maven/org.geoserver:gs-wps<2.18.6
2.18.6
maven/org.geoserver:gs-wfs>=2.20.0<2.20.4
2.20.4
maven/org.geoserver:gs-wms>=2.20.0<2.20.4
2.20.4
maven/org.geoserver:gs-wfs>=2.19.0<2.19.6
2.19.6
maven/org.geoserver:gs-wms>=2.19.0<2.19.6
2.19.6
maven/org.geoserver:gs-wfs<2.18.6
2.18.6
maven/org.geoserver:gs-wms<2.18.6
2.18.6
GeoServer geoserver>=2.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade maven/org.geoserver:gs-wps to a version that resolves this vulnerability.

    Fixed in 2.20.4
  2. Upgrade

    Upgrade maven/org.geoserver:gs-wps to a version that resolves this vulnerability.

    Fixed in 2.19.6
  3. Upgrade

    Upgrade maven/org.geoserver:gs-wps to a version that resolves this vulnerability.

    Fixed in 2.18.6
  4. Upgrade

    Upgrade maven/org.geoserver:gs-wfs to a version that resolves this vulnerability.

    Fixed in 2.20.4
  5. Upgrade

    Upgrade maven/org.geoserver:gs-wms to a version that resolves this vulnerability.

    Fixed in 2.20.4
  6. Upgrade

    Upgrade maven/org.geoserver:gs-wfs to a version that resolves this vulnerability.

    Fixed in 2.19.6
  7. Upgrade

    Upgrade maven/org.geoserver:gs-wms to a version that resolves this vulnerability.

    Fixed in 2.19.6
  8. Upgrade

    Upgrade maven/org.geoserver:gs-wfs to a version that resolves this vulnerability.

    Fixed in 2.18.6
  9. Upgrade

    Upgrade maven/org.geoserver:gs-wms to a version that resolves this vulnerability.

    Fixed in 2.18.6
  10. Remove

    Remove janino-<version>.jar from your environment.

    Open the GeoServer WAR file, navigate to WEB-INF/lib, remove the janino-<version>.jar, then restart GeoServer.

Event History

Jun 12, 2023
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Disputed
03:15 PM
Data Sourced
via NVD·03:15 PM
DescriptionSeverityAffected Software
Advisory Published
03:30 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2023-35042?

CVE-2023-35042 is a vulnerability in GeoServer 2 that allows remote attackers to execute arbitrary code.

2

How severe is CVE-2023-35042?

CVE-2023-35042 has a severity rating of 9.8, which is considered critical.

3

What software versions are affected by CVE-2023-35042?

Versions between 2.0.0 and 2.20.4 of the GeoServer gs-wps, gs-wfs, and gs-wms packages are affected.

4

How can I fix CVE-2023-35042?

To fix CVE-2023-35042, update the affected GeoServer packages to version 2.20.4 for gs-wps, gs-wfs, and gs-wms.

5

Where can I find more information about CVE-2023-35042?

You can find more information about CVE-2023-35042 at the following references: [1] [2] [3].

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203