CVE-2026-77328 in MapServerinfo

Summary

by MITRE • 11/20/2026

MapServer is a system for developing web-based GIS applications. Prior to 8.6.5, MapServer's PostgreSQL JOIN implementation in src/mappostgresql.c copies the source layer attribute selected by JOIN FROM into joininfo->from_value and embeds it without parameterization or escaping into a dynamically generated PostgreSQL query executed by PQexec(). When PostgreSQL JOIN support is enabled, an attacker who can control that source feature attribute can inject quote characters and SQL operators that alter the intended WHERE predicate. This second-order injection can cause unintended rows and JOIN attributes to be returned, potentially exposing information from unrelated PostgreSQL records. This issue is fixed in version 8.6.5.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 11/20/2026

MapServer serves as a critical infrastructure component for developing web-based Geographic Information System applications, facilitating the integration of spatial data with web services. A significant security vulnerability was identified within its PostgreSQL JOIN implementation prior to version 8.6.5, specifically located in the source file src/mappostgresql.c. This flaw stems from an improper handling of user-controlled input during the construction of dynamic SQL queries. When a client requests a join operation involving a PostgreSQL layer, MapServer retrieves attribute values from the source feature and assigns them to the joininfo->from_value structure. Instead of treating these values as data parameters that require sanitization or parameterized binding, the system directly embeds these raw strings into the dynamically generated SQL query string before execution via PQexec(). This architectural decision creates a classic injection vector where untrusted input is interpreted as executable code by the database engine.

The technical nature of this flaw constitutes an Insecure Direct Object Reference combined with Second-Order SQL Injection, aligning closely with CWE-89 Improper Neutralization of Special Elements used in an SQL Command and CWE-601 URL Redirection to Untrusted Site. Because the injection occurs through data that was previously stored or processed by the application rather than directly from a single request parameter at the point of execution, it is classified as second-order. An attacker who can control the source feature attribute utilized in the JOIN operation can inject specific quote characters and SQL operators into the query string. By manipulating these elements, the attacker alters the logical structure of the intended WHERE predicate, effectively bypassing the original filtering conditions imposed by the application logic.

The operational impact of this vulnerability is severe, primarily resulting in unauthorized data exposure through unintended row retrieval. Since the injected SQL commands modify the JOIN condition or subsequent clauses, an adversary can force PostgreSQL to return rows and associated attributes that were not originally intended for disclosure. This allows for the extraction of sensitive information from unrelated records within the database schema. In a GIS context where spatial data may include private property boundaries, infrastructure details, or personal location history, such leakage represents a critical breach of confidentiality. The attacker does not need to inject arbitrary commands like DROP TABLE but rather manipulates logical predicates to expand the result set beyond authorized bounds, leading to information disclosure without necessarily compromising database integrity or availability.

This vulnerability maps directly to MITRE ATT&CK technique T1059 Command and Scripting Interpreter under SQL Injection sub-techniques, specifically illustrating how application logic flaws can be leveraged for data exfiltration. The attack path involves the attacker providing malicious input that is stored in a feature attribute, which is later processed during a JOIN operation to construct an unsafe query. Mitigation strategies must prioritize upgrading MapServer to version 8.6.5 or later, where this specific implementation flaw has been corrected by implementing proper parameterization and escaping mechanisms for all dynamic SQL components. For environments unable to upgrade immediately, administrators should enforce strict input validation on any attributes used in JOIN operations, ensuring that only expected data types are accepted and special characters are neutralized before they reach the database layer. Additionally, employing least-privilege principles for the database user account running MapServer can limit the potential damage of successful injection attempts by restricting access to sensitive tables or columns not required for standard GIS functionality.

Responsible

GitHub M

Reservation

08/20/2026

Disclosure

11/20/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!