Summary
CVE-2026-76904 is a critical, unauthenticated SQL injection vulnerability in GeoTools, the open-source geospatial data library used by GeoServer and other GIS applications. The flaw resides in the jsonArrayContains OGC filter function of the PostGIS DataStore implementation, where a user-controlled value is concatenated directly into a generated SQL statement without sanitization. Because the vulnerability requires no authentication or user interaction and can be triggered over the network, it carries a CVSS v3.1 score of 9.8 (Critical), and depending on database privileges it can escalate to remote code execution.
Technical details
- Root cause: The
jsonArrayContains(<column>, <pointer>, <value>)filter function, implemented in the PostGIS filter-to-SQL translation logic (gt-jdbc-postgismodule), writes the<value>parameter into the generated SQL query without escaping or parameterization. - Trigger conditions: Exploitable only when GeoTools/GeoServer is backed by a PostGIS datastore running PostGIS 12 or later, with a layer containing a String or JSON-typed field that can be targeted via an OGC Filter using
jsonArrayContains. - Attack vector: Network-based; an attacker sends a crafted OGC filter request (e.g., via WFS/WMS requests handled by GeoServer or any application embedding the vulnerable GeoTools module) containing malicious SQL in the
<value>argument. - Impact: Full compromise of confidentiality, integrity, and availability of the backing database. This is a regression of the earlier CVE-2023-25158 issue, specific to the
jsonArrayContainsfunction — the previous mitigation (enabling prepared statements and disabling encode functions) does not prevent this vulnerability. If the database connection used by GeoServer/GeoTools has elevated privileges (e.g., PostgreSQL superuser or a role with program-execution rights), the flaw can be leveraged to achieve operating system command execution.
Affected software
- GeoTools versions 30.5 up to 33.5
- GeoTools versions 34.0 up to 34.4
- GeoTools version 35.0
- Applications and platforms bundling these GeoTools versions with a PostGIS datastore (notably GeoServer builds incorporating the affected GeoTools releases) inherit this vulnerability when PostGIS 12+ is in use.
Severity
- CVSS v3.1 Base Score: 9.8 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: Upgrade to the patched GeoTools releases: 33.6, 34.5, or 35.1 (or later). Users running GeoServer should upgrade to the corresponding fixed distributions: GeoServer 2.27.6, 2.28.5, or 3.0.1.
- If patching cannot be applied immediately: The official advisory states no complete workaround exists — configuring the PostGIS database connection pool to use a role with the minimum necessary privileges (avoiding superuser or program-execution rights) can reduce the potential impact if exploitation occurs, but does not close the injection itself. Restricting network exposure of GeoServer/GeoTools instances and monitoring database logs for anomalous queries against PostGIS-backed layers is also recommended until patches are applied.

