CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-76904

CVE-2026-76904: Unauthenticated SQL Injection in GeoTools PostGIS DataStore Component

Alon Barad
Alon Barad
Software Engineer

Aug 22, 2026·5 min read·137 visits

Executive Summary (TL;DR)

An unauthenticated SQL injection vulnerability in the GeoTools `jsonArrayContains` OGC filter function allows remote attackers to execute arbitrary database commands and potentially achieve remote code execution by exploiting unsanitized input parsing in PostGIS database queries.

A critical SQL injection vulnerability exists in the GeoTools open-source Java library. This vulnerability is situated within the post-processing phase of OGC Filter conversion inside the PostGIS DataStore module. Specifically, the `jsonArrayContains` function does not validate or sanitize its arguments before constructing PostgreSQL SQL/JSON path evaluation queries. An unauthenticated remote attacker can exploit this weakness by submitting crafted filters via standard OGC services like WFS or WMS to execute arbitrary SQL commands on the underlying database system.

Vulnerability Overview

The GeoTools open-source Java library provides standard-compliant methods for manipulating geospatial data. The library's gt-jdbc-postgis module allows client applications to connect to PostgreSQL/PostGIS database backends. When users submit spatial queries through Web Feature Service (WFS) or Web Map Service (WMS) endpoints, GeoTools translates high-level OGC Filter expressions into native database queries.

The vulnerability is located within the implementation of the jsonArrayContains filter function, designed to facilitate native querying of JSON or string array structures on modern PostgreSQL backends. Because this function exposes an attack surface that translates user-supplied parameters into database execution parameters, lack of rigorous boundary isolation within the query-generation module results in a SQL injection vulnerability.

This security weakness is classified under CWE-89 (Improper Neutralization of Special Elements used in an SQL Command). The consequences of successful exploitation range from unauthorized access to sensitive database schemas to total system compromise on the database server if the connection pool operates with high privilege levels.

Root Cause Analysis

To support JSON query operations, GeoTools uses PostgreSQL's SQL/JSON path engine, introduced natively in PostgreSQL 12. The underlying database engine processes path evaluations using the jsonb_path_exists function, which expects its arguments as format strings or parameters. The dynamic compilation of this function occurs in modules/plugin/jdbc/jdbc-postgis/src/main/java/org/geotools/data/postgis/FilterToSqlHelper.java.

The specific point of failure resides in the constructEquality method, which is responsible for building the key-value comparison string within the generated JSON path expression. Instead of utilizing parameterized query interfaces or sanitizing the input characters, the GeoTools translation engine formats the expression dynamically using Java's String.formatted framework.

When the compiler processes the string literal argument, it incorporates the user input directly into the comparison query template: (@.%s == "%s"). Because the library does not execute escaping or character substitution before formatting, input data that contains unescaped single or double quotes breaks out of the string context. This allows an attacker to manipulate the boundary of the query, resulting in arbitrary SQL command execution within the database engine.

Code Analysis

The vulnerable implementation in FilterToSqlHelper.java accepts the target array and value parameters to generate the query comparison string:

// Vulnerable Code Path in FilterToSqlHelper.java
private String constructEquality(String[] jsonPath, Expression expected) {
    // ... evaluation logic ...
    } else if (value instanceof Double double1) {
        return "(@.%s == %f)".formatted(jsonPath[lastIndex], double1);
    }
    // Vulnerability: Direct string formatting without escaping
    return "(@.%s == \"%s\")".formatted(jsonPath[lastIndex], value);
}

The patched version introduces string preprocessing to properly escape characters that could alter the semantic structure of the generated SQL/JSON instruction:

// Patched Code Path with escapeJsonLiteral Integration
private String constructEquality(String[] jsonPath, Expression expected) {
    // ... evaluation logic ...
    } else if (value instanceof Double double1) {
        return "(@.%s == %f)".formatted(jsonPath[lastIndex], double1);
    }
    // Remediation: Escaping characters using escapeJsonLiteral
    String literal = escapeJsonLiteral(String.valueOf(value));
    return "(@.%s == \"%s\")".formatted(jsonPath[lastIndex], literal);
}

The vulnerability is fully addressed because the escapeJsonLiteral method converts double quotes (") to escaped format strings (\") to neutralize the JSON path boundary break. Simultaneously, single quotes (') are doubled ('') to ensure the outer SQL query engine does not evaluate user input as a query delimiter, maintaining structural integrity across both the SQL and JSON parsers.

Exploitation Methodology

An attacker can exploit this vulnerability by submitting a maliciously constructed ECQL filter string via standard OGC WFS or WMS protocols. Exploitation does not require authentication or user interaction.

To construct an exploit, the attacker crafts a request using the jsonArrayContains function, passing a SQL comment or boolean evaluation statement inside the value field. The payload uses nested quote boundaries to escape the JSON query parameters. For example, the attacker can pass a payload containing SQL statements like payload" OR (SELECT 1 FROM pg_sleep(5)) IS NOT NULL --.

When GeoTools compiles the OGC request, the PostGIS dialect helper translates the filter into SQL format:

SELECT * FROM target_table WHERE jsonb_path_exists(column::jsonb, '$ ? (@.property == "payload" OR (SELECT 1 FROM pg_sleep(5)) IS NOT NULL --")')

During execution, the PostgreSQL server evaluates the outer SQL query logic, parsing the sleep command directly. A successful delay of execution demonstrates blind SQL injection capability, allowing the attacker to construct automation scripts to extract data, download configuration files, or interact with database services.

Impact Assessment

The impact of this SQL injection vulnerability is classified as critical. It exposes the application infrastructure to unauthorized data retrieval, system modifications, and full backend database takeover.

Attackers can exfiltrate sensitive data, including administrative credentials and proprietary geospatial datasets, by extracting schema records through automated SQL blind techniques. If the database schema has write permissions, attackers can perform database modification attacks, altering spatial geometries, system configurations, or service permissions.

Under configurations where the database process runs with superuser privileges or filesystem write access, attackers can escalate access. Utilizing PostgreSQL functions such as COPY ... FROM PROGRAM or standard large objects APIs allows the executing process to execute arbitrary OS commands, achieving remote code execution on the hosting infrastructure.

Remediation and Verification

The standard remediation pathway is upgrading the GeoTools library dependency to a patched release. All applications using the gt-jdbc-postgis package must ensure they build against secure library versions.

The vulnerability is resolved in GeoTools releases 33.6, 34.5, and 35.1. Developers utilizing Maven or Gradle build environments should update their dependency configurations to reflect these versions or newer releases.

If immediate deployment of upgraded software is not possible, administrative workarounds must be applied. Configure database user connection pools with limited privileges, restricting access to administrative system tables and filesystems. Implement rules on Web Application Firewalls (WAF) to search for and block HTTP requests featuring SQL keywords or unmatched single quotes within the ECQL or WFS request payload.

Official Patches

GeoTools GitOfficial remediation patch commit
GeoTools Pull RequestAssociated pull request

Fix Analysis (1)

Technical Appendix

CVSS Score
9.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected Systems

GeoTools geospatial libraryGeoServer installations leveraging PostGIS data storesJava-based spatial middleware utilizing gt-jdbc-postgis modules

Affected Versions Detail

Product
Affected Versions
Fixed Version
GeoTools
OSGeo
>= 30.5, < 33.633.6
GeoTools
OSGeo
>= 34.0, < 34.534.5
GeoTools
OSGeo
35.035.1
AttributeDetail
CWE IDCWE-89
Attack VectorNetwork (AV:N)
CVSS v3.19.8 (Critical)
Exploit StatusPoC (Proof of Concept)
ImpactUnauthenticated SQL Injection & potential Remote Code Execution
Componentgt-jdbc-postgis (PostGIS DataStore)
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-89
SQL Injection

Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

References & Sources

  • [1]GitHub Security Advisory GHSA-mqjf-5f49-2fjh
  • [2]GeoTools Remediation Commit d821c4d321dd91c22e31fcd5b1ce676645da5176
  • [3]GeoTools Pull Request 5829
  • [4]GeoTools 33.6 Release Tag
  • [5]GeoTools 34.5 Release Tag
  • [6]GeoTools 35.1 Release Tag
  • [7]OSGeo Bug Tracker GEOT-7589
  • [8]OSGeo Bug Tracker GEOT-7958
  • [9]OSGeo Bug Tracker GEOT-7959

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•15 minutes ago•CVE-2026-46429
5.5

CVE-2026-46429: Unrestricted File Upload and Validation Bypass in GeoNode

GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.

Amit Schendel
Amit Schendel
1 views•10 min read
•about 1 hour ago•CVE-2026-55649
6.3

CVE-2026-55649: Stored Cross-Site Scripting in GeoNode Document Metadata Abstract Field

CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.

Amit Schendel
Amit Schendel
4 views•9 min read
•about 2 hours ago•GHSA-QX75-2P3R-PWM5
7.7

CVE-2026-55622: Cross-Project Instance Copy Authorization Bypass in Canonical LXD and LXC Incus

CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.

Amit Schendel
Amit Schendel
3 views•11 min read
•about 3 hours ago•GHSA-7MR3-28H5-M5VX
7.7

GHSA-7mr3-28h5-m5vx: Authorization Bypass and Cross-Project Volume Copy in Canonical LXD

An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.

Alon Barad
Alon Barad
3 views•10 min read
•about 4 hours ago•GHSA-47W9-6R3F-938G
9.9

GHSA-47w9-6r3f-938g: Authorization Bypass and Host Root Command Execution in Canonical LXD and Incus

A missing authorization and configuration validation vulnerability in Canonical LXD and LXC Incus allows authenticated users within restricted projects to bypass project security boundaries. By smuggling prohibited low-level configuration directives (such as raw.lxc or raw.qemu) inside instance snapshots or backup archives, an attacker can restore these configurations within a restricted project and execute arbitrary commands with root privileges on the underlying host operating system.

Alon Barad
Alon Barad
4 views•11 min read
•about 5 hours ago•GHSA-JPF8-86F3-WP38
9.9

CVE-2026-48752: Arbitrary Host File Read and Write via Templates Symlink in Canonical LXD and Incus

A symbolic link traversal vulnerability (CWE-59) in Canonical LXD and Linux Containers Incus allows an authenticated user with image import permissions to read and write arbitrary files on the host filesystem. During image archive unpacking, the daemon fails to reject top-level symbolic links for the instance `templates` directory. Subsequent requests to the instance template API endpoints follow this symbolic link outside the instance storage directory with root privileges, enabling complete host compromise.

Amit Schendel
Amit Schendel
4 views•10 min read