CVE-2026-76904
JSON

9.8critical

GeoTools has unauthenticated SQL injection in the jsonArrayContains filter function against PostGIS layers

Severity
9.8critical CVSS:3.1 by GitHub_M
Exploit likelihood
29.8% (higher than 98% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-mqjf-5f49-2fjh

Description

GeoTools is an open source Java library that provides tools for geospatial data. Starting in version 30.5 and prior to versions 33.6, 34.5, and 33.6, an SQL Injection Vulnerability is present when executing OGC Filters with PostGIS DataStore implementation: `jsonArrayContains` function; Requires PostGIS 12 or greater with a String or JSON field. For PostGIS 12 and greater `jsonArrayContains(<column>, <pointer>, <value>)` function writes `<value>` into generated SQL without escaping. Patches are available in versions 33.6, 34.5, and 33.6. No known workaround is available. To limit scope of SQL Injection the PostGIS connection pool should be configured with limited rights.

Affected

Product or packageVersionsReported by
geotools geotools= 35.0, >= 34.0, < 34.5, >= 30.5, < 33.6CVE List
org.geotools.jdbc:gt-jdbc-postgis (Maven)from 35.0 before 35.1, from 34.0 before 34.5, from 30.5 before 33.6GitHub Advisory Database

All scores

GitHub_M9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-89

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

GeoTools is an open source Java library that provides tools for geospatial data. Starting in version 30.5 and prior to versions 33.6, 34.5, and 33.6, an SQL Injection Vulnerability is present when executing OGC Filters with PostGIS DataStore implementation: `jsonArrayContains` function; Requires PostGIS 12 or greater with a String or JSON field. For PostGIS 12 and greater `jsonArrayContains(<column>, <pointer>, <value>)` function writes `<value>` into generated SQL without escaping. Patches are available in versions 33.6, 34.5, and 33.6. No known workaround is available. To limit scope of SQL Injection the PostGIS connection pool should be configured with limited rights.

GitHub Advisory Database
Summary

An SQL Injection Vulnerability has been found when executing OGC Filters with PostGIS DataStore implementation:

  • jsonArrayContains function
    Requires PostGIS 12 or greater with a String or JSON field

For PostGIS 12 and greater jsonArrayContains(<column>, <pointer>, <value>) function writes <value> into generated SQL without escaping.

Patches
  • GeoTools 35.1
  • GeoTools 33.5
  • GeoTools 34.4
Mitigation

No mitigation is available:

  • To limit scope of SQL Injection the PostGIS connection pool should be configured with limited rights.
Impact

This vulnerability can lead to execution of arbitrary SQL expressions in the database.

References
NVD (es)

GeoTools es una biblioteca Java de código abierto que proporciona herramientas para datos geoespaciales. A partir de la versión 30.5 y antes de las versiones 33.6, 34.5 y 33.6, existe una vulnerabilidad de inyección SQL al ejecutar filtros OGC con la implementación de PostGIS DataStore: función 'jsonArrayContains'; Requiere PostGIS 12 o superior con un campo de tipo String o JSON. Para PostGIS 12 y superior, la función 'jsonArrayContains(<column>, <pointer>, <value>)' escribe '<value>' en el SQL generado sin escapar. Los parches están disponibles en las versiones 33.6, 34.5 y 33.6. No se conoce ninguna solución alternativa disponible. Para limitar el alcance de la inyección SQL, el pool de conexiones de PostGIS debe configurarse con derechos limitados.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-76904 changed 2026-08-27CVE Terms of Use
GitHub Advisory DatabaseGHSA-mqjf-5f49-2fjh changed 2026-08-21CC-BY-4.0
NVDCVE-2026-76904 changed 2026-11-30Public domain