# CVE-2026-76904: GeoTools has unauthenticated SQL injection in the jsonArrayContains filter function against PostGIS layers

> Attackers can execute arbitrary SQL commands via unauthenticated OGC filters in GeoTools when using PostGIS layers with specific JSON fields.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Aug 2026
- **Updated:** 27 Aug 2026
- **Also known as:** GHSA-mqjf-5f49-2fjh

## What is CVE-2026-76904?

CVE-2026-76904 is a critical SQL injection vulnerability in geotools, published on 21 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-89 (Improper Neutralization of Special Elements used in an SQL Command)

## Which versions are affected by CVE-2026-76904?

6 open source packages ship an affected version, including org.geotools.jdbc:gt-jdbc-postgis.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.geotools.jdbc:gt-jdbc-postgis` | Maven | From 30.5 | 33.6 |
| `org.geotools.jdbc:gt-jdbc-postgis` | Maven | From 30.5 | 33.6 |
| `org.geotools.jdbc:gt-jdbc-postgis` | Maven | From 34.0 | 34.5 |
| `org.geotools.jdbc:gt-jdbc-postgis` | Maven | From 34.0 | 34.5 |
| `org.geotools.jdbc:gt-jdbc-postgis` | Maven | From 35.0 | 35.1 |
| `org.geotools.jdbc:gt-jdbc-postgis` | Maven | From 35.0 | 35.1 |

## How do I fix CVE-2026-76904?

Upgrade org.geotools.jdbc:gt-jdbc-postgis to a fixed version for your release line: 33.6, 34.5 or 35.1.

## Is CVE-2026-76904 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-76904 exists.

Public exploit code:

- One-Day POC | GeoServer Unauthenticated SQL injection to complete RCE (github_poc): https://github.com/YonLiud/CVE-2026-76904
- PostGIS SQL Injection GeoTools (github_poc): https://github.com/bickZero93/CVE-2026-76904
- GeoServer jsonArrayContains CQL Filter - SQL Injection (nuclei): http/cves/2026/CVE-2026-76904.yaml

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-76904 and fix it if it is affected.

What it is: CVE-2026-76904 is a critical SQL injection vulnerability in geotools, published on 21 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-76904 exists.

Affected packages and fixed versions:
- org.geotools.jdbc:gt-jdbc-postgis (Maven): affected from 30.5; fixed in 33.6
- org.geotools.jdbc:gt-jdbc-postgis (Maven): affected from 30.5; fixed in 33.6
- org.geotools.jdbc:gt-jdbc-postgis (Maven): affected from 34.0; fixed in 34.5
- org.geotools.jdbc:gt-jdbc-postgis (Maven): affected from 34.0; fixed in 34.5
- org.geotools.jdbc:gt-jdbc-postgis (Maven): affected from 35.0; fixed in 35.1
- org.geotools.jdbc:gt-jdbc-postgis (Maven): affected from 35.0; fixed in 35.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-76904/ (Markdown: https://insights.sbomify.com/CVE-2026-76904/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-76904
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-76904
- OSV: https://osv.dev/vulnerability/CVE-2026-76904

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-76904/
Summaries are generated and may contain mistakes; the official description above is the record.
