SQL injection in MapServer PostgreSQL JOIN handling
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- SQL injection
- Confidentiality · integrity · availability
- None · None · None
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-89.
Summary
MapServer before 8.6.5 builds a PostgreSQL query for JOIN support by embedding a source layer attribute without parameterization or escaping, so the value is not neutralized before PQexec() runs. When PostgreSQL JOIN support is enabled, an attacker who controls that source feature attribute can inject SQL operators that change the WHERE predicate. This second-order SQL injection (CWE-89) can return unintended rows and JOIN attributes, potentially exposing data from unrelated PostgreSQL records. An unauthenticated remote attacker can exploit it with low complexity.
Written with Claude Haiku 5.5 from the sources below · 2026-11-25
Description from the CNA
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
Remediation
Upgrade MapServer to version 8.6.5, which fixes this issue.
Written with Claude Haiku 5.5 from the sources below · 2026-11-25
- Fix · CNA MapServer (MapServer) Fixed in 8.6.5
Timeline
- 2026-11-20 Threatist record created from CVE-2026-77328
- 2026-11-25 CISA SSVC decision points changed
References
Other 6
- https://github.com/MapServer/MapServer/security/advisories/GHSA-m3xh-ccmh-x8rw
- https://github.com/MapServer/MapServer/pull/7546
- https://github.com/MapServer/MapServer/pull/7566
- https://github.com/MapServer/MapServer/commit/05babb88314b8f022eb47a3ab1a00eb37f92085f
- https://github.com/MapServer/MapServer/commit/a39a299a03a767dd966bb40caf044539e7813bce
- https://github.com/MapServer/MapServer/releases/tag/rel-8-6-5
More OSGeo vulnerabilities
- TI-2024-24187 Remote code execution in GeoServer via property name expressions KEVCVSS 3.1CRITICAL 9.8
- TI-2022-08629 Code generation flaw in jai-ext enables remote code execution KEVCVSS 3.1CRITICAL 10.0
- TI-2025-36149 Unauthenticated XXE in GeoServer WMS GetMap request KEVCVSS 3.1CRITICAL 9.8
- TI-2026-101125 Service security bypass in GeoServer via prefixed service names KEVCVSS 4.0HIGH 8.8
- TI-2026-101124 Unauthenticated XML injection in GeoServer WFS GetFeatureById KEVCVSS 3.1HIGH 8.6
- TI-2025-36983 MapServer - WFS XML Filter Query SQL injection CVSS 4.0HIGH 8.9
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences