Patchfirst
CVE-2023-25158 Critical · 9.8 EPSS 1.1%

Unfiltered SQL Injection in Geotools

Fix:upgrade gt-jdbc to 28.2 or later Details ↓

geotools · geotools

Summary

An unfiltered SQL injection flaw exists in GeoTools, an open source Java library for geospatial data, where OGC Filter expressions are executed against JDBCDataStore implementations. An attacker with network access and no authentication or user interaction can inject SQL through these filters, and the flaw can be mitigated by disabling encode functions for PostGIS DataStores or enabling prepared statements for JDBCDataStores until the library is upgraded.

Official description · CVE.org

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.

Breakdown
55.8 / 100
Exploited
Yes, in VulnCheck KEV
Reports
0
Tactics
0/15

First seen exploited 3 years after disclosure.

  1. Disclosedday 0
  2. First seen exploitedVulnCheck KEV evidence+3 yrs

2 related vulnerabilities in the same code over 3 years.

Linked vulnerabilitiesLinked by evidence that a fix failed or the same code was patched again. Oldest first.

  1. This CVECVE-2023-25158Unfiltered SQL Injection in Geotools21 Feb 2023
  2. relatedMedium

    Why these are linked:

    • Same code patched: FilterToSqlHelper.java (machine-matched)commit 64fb4c4commit d821c4d
    • Similar weakness in the same product (machine-matched)same product + CWE + description similarity
    CVE-2026-76904GeoTools has unauthenticated SQL injection in the…21 Aug 2026

Affected versions and fixes

as published in the CVE record

geotools geotools

Affected: >= 28.0, < 28.2 · < 27.4

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: org.geotools:gt-jdbc.

Mavenorg.geotools:gt-jdbcGHSA-99c3-qc2q-p94m

Upgrade to 28.2 or later

Set the version to 28.2 or later in your pom.xml or build.gradle.

The first fix for CVE-2023-25158. No other CVE tracked by Patchfirst affects this package.

Affected versions, by release line

If you runUpgrade to
28.0 up to 28.228.2
27.0 up to 27.427.4
26.0 up to 26.726.7
25.0 up to 25.725.7
All versions before 24.724.7

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

What security researchers reported

Not named in any threat report yet

Also mentioned in 1 community threat pulse (AlienVault OTX)

Weaker evidence

Pulses are indicator collections that anyone can publish. A mention is not confirmation of exploitation.

References

2 links, grouped by NVD tag
↑ ↓ chooseEnter openEsc close