一、 漏洞 CVE-2023-25157 基础信息
漏洞信息
                                        # 未过滤的Geoserver SQL注入漏洞

## 漏洞概述
GeoServer 是一个用 Java 编写的开源软件服务器,允许用户共享和编辑地理空间数据。它支持开放地理空间联盟(OGC)的 Filter 表达式语言和通用查询语言(CQL),并在 Web Feature Service (WFS) 和 Web Map Service (WMS) 协议中使用。此外,CQL 也通过 Web Coverage Service (WCS) 协议支持 ImageMosaic 覆盖图。用户需升级到 2.21.4 或 2.22.2 版本来解决此问题,或者对现有版本进行配置更改以减轻风险。

## 影响版本
- GeoServer 2.21.x 版本低于 2.21.4
- GeoServer 2.22.x 版本低于 2.22.2

## 细节
GeoServer 的 CQL 和 Filter 表达式语言处理存在漏洞,攻击者可以通过构造恶意查询触发这些漏洞。具体漏洞涉及:
- 使用 `strEndsWith`、`strStartsWith` 和 `PropertyIsLike` 方法的不当使用。
- 使用 `FeatureId` 的不当使用。

## 影响
- 用户需升级到版本 2.21.4 或 2.22.2 来修复该问题。
- 用户如无法升级,需禁用 PostGIS 数据库的 `encode functions` 设置以减轻 `strEndsWith`、`strStartsWith` 和 `PropertyIsLike` 的误用,并启用 PostGIS 数据库的 `preparedStatements` 设置以减轻 `FeatureId` 的误用。
                                        
提示
尽管我们采用了先进的大模型技术,但其输出仍可能包含不准确或过时的信息。
神龙会尽力确保数据准确,但也请结合实际情况进行甄别与判断。
神龙祝您一切顺利!
漏洞标题
Unfiltered SQL Injection Vulnerabilities in Geoserver
来源:美国国家漏洞数据库 NVD
漏洞描述信息
GeoServer is an open source software server written in Java that allows users to share and edit geospatial data. GeoServer includes support for the OGC Filter expression language and the OGC Common Query Language (CQL) as part of the Web Feature Service (WFS) and Web Map Service (WMS) protocols. CQL is also supported through the Web Coverage Service (WCS) protocol for ImageMosaic coverages. Users are advised to upgrade to either version 2.21.4, or version 2.22.2 to resolve this issue. Users unable to upgrade should disable the PostGIS Datastore *encode functions* setting to mitigate ``strEndsWith``, ``strStartsWith`` and ``PropertyIsLike `` misuse and enable the PostGIS DataStore *preparedStatements* setting to mitigate the ``FeatureId`` misuse.
来源:美国国家漏洞数据库 NVD
CVSS信息
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
来源:美国国家漏洞数据库 NVD
漏洞类别
SQL命令中使用的特殊元素转义处理不恰当(SQL注入)
来源:美国国家漏洞数据库 NVD
漏洞标题
GeoServer SQL注入漏洞
来源:中国国家信息安全漏洞库 CNNVD
漏洞描述信息
GeoServer是一个用 Java 编写的开源软件服务器。允许用户共享和编辑地理空间数据。 GeoServer 2.21.4之前、2.22.2之前版本存在安全漏洞,该漏洞源于 ``strEndsWith``、``strStartsWith`` 和 ``PropertyIsLike `` 存在滥用 问题。
来源:中国国家信息安全漏洞库 CNNVD
CVSS信息
N/A
来源:中国国家信息安全漏洞库 CNNVD
漏洞类别
SQL注入
来源:中国国家信息安全漏洞库 CNNVD
二、漏洞 CVE-2023-25157 的公开POC
# POC 描述 源链接 神龙链接
1 CVE-2023-25157 - GeoServer SQL Injection - PoC https://github.com/win3zz/CVE-2023-25157 POC详情
2 CVE-2023-25157 SQL injection vulnerability found in GeoServer https://github.com/drfabiocastro/geoserver POC详情
3 None https://github.com/0x2458bughunt/CVE-2023-25157 POC详情
4 GeoServer & GeoTools SQL Injection (CVE-2023-25157 & CVE-2023-25158) https://github.com/murataydemir/CVE-2023-25157-and-CVE-2023-25158 POC详情
5 A script, written in golang. POC for CVE-2023-25157 https://github.com/7imbitz/CVE-2023-25157-checker POC详情
6 GeoServer OGC Filter SQL Injection Vulnerabilities https://github.com/Rubikcuv5/CVE-2023-25157 POC详情
7 Geoserver SQL Injection Exploit https://github.com/dr-cable-tv/Geoserver-CVE-2023-25157 POC详情
8 GeoServer is an open source software server written in Java that allows users to share and edit geospatial data. GeoServer includes support for the OGC Filter expression language and the OGC Common Query Language (CQL) as part of the Web Feature Service (WFS) and Web Map Service (WMS) protocols. CQL is also supported through the Web Coverage Service (WCS) protocol for ImageMosaic coverages. Users are advised to upgrade to either version 2.21.4, or version 2.22.2 to resolve this issue. Users unable to upgrade should disable the PostGIS Datastore *encode functions* setting to mitigate ``strEndsWith``, ``strStartsWith`` and ``PropertyIsLike `` misuse and enable the PostGIS DataStore *preparedStatements* setting to mitigate the ``FeatureId`` misuse. https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2023/CVE-2023-25157.yaml POC详情
9 None https://github.com/Threekiii/Awesome-POC/blob/master/%E4%B8%AD%E9%97%B4%E4%BB%B6%E6%BC%8F%E6%B4%9E/GeoServer%20OGC%20Filter%20SQL%E6%B3%A8%E5%85%A5%E6%BC%8F%E6%B4%9E%20CVE-2023-25157.md POC详情
10 https://github.com/vulhub/vulhub/blob/master/geoserver/CVE-2023-25157/README.md POC详情
三、漏洞 CVE-2023-25157 的情报信息