Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessStore SQL payload in source layer attribute (JOIN FROM key)
-
DeliverySend map request triggering PostgreSQL JOIN
-
Exploitfrom_value embedded unescaped into PQexec query
-
ExecutionInjected quotes alter WHERE predicate
-
ImpactUnintended PostgreSQL join rows disclosed
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Persistence The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires a specific, non-default stack: MapServer must be built with PostgreSQL/PostGIS support (USE_POSTGIS) and a mapfile must define a JOIN with CONNECTIONTYPE POSTGRESQL whose FROM references a source-layer attribute. Critically, because this is second-order injection, the attacker must be able to control or taint the value of that JOIN FROM source attribute (e.g. an untrusted shapefile DBF field such as FNAME) so the payload is stored and later reused when JOIN processing runs. The CVSS 4.0 vector reports PR:N (no MapServer authentication to trigger the request) and UI:N, but the practical limiting factors are: PostgreSQL JOIN must be enabled and configured, the source attribute must be attacker-influenceable, and impact is bounded to data in the configured join table (SC:L/SI:L) - not arbitrary database or host compromise. Deployments that only consume fully trusted source data, or that do not use PostgreSQL JOIN, are not exposed. |
| Impact | This is a genuine but conditional, mid-severity issue rather than a drop-everything emergency. The official CVSS 4.0 score is 6.9 (Medium) with vector AV:N/AC:L/PR:N/UI:N and impact confined to the subsequent system (VC:N/VI:N/VA:N but SC:L/SI:L) - i.e. limited confidentiality/integrity exposure of the PostgreSQL join table, no availability impact and no compromise of MapServer itself. No EPSS score and no KEV listing are present in the supplied data, so there is no evidence of active or automated exploitation; the vuln.today decision label is 'this_month', consistent with a patch-on-normal-cycle priority rather than act_now/emergency. The key moderating factor is that this is a SECOND-ORDER injection: the attacker must first get a malicious value stored in the source layer attribute referenced by JOIN FROM, and PostgreSQL JOIN support must be compiled and configured - so despite PR:N/AC:L in the vector, real-world exploitability depends on whether untrusted data can reach that attribute. The GHSA advisory contains a documented proof-of-concept with reproduction steps, but the input provides no 'POC: Publicly available (confirmed)' signal, so it should be treated as a described PoC, not a verified drop-in weaponized exploit. Net: real and worth patching this cycle, but its practical risk is gated by deployment specifics, not a broad internet-wide threat. |
| Exploit ScenarioDerived | An attacker who can influence a source-layer feature attribute (e.g. a shapefile DBF field like FNAME used as the JOIN FROM key) stores a payload such as x'OR'1'='1. When a later CGI/HTTP map request triggers PostgreSQL JOIN processing, MapServer copies that value into joininfo->from_value and embeds it unescaped into a query run via PQexec(), altering the intended WHERE predicate and returning unintended rows from the join table. A detailed PoC exists in the GHSA advisory; because exploitation is remote-triggerable (PR:N) but requires prior control of the stored source attribute, it is a stored/second-order SQL injection rather than a direct request-time injection. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 20, 2026
Second-order SQL injection in MapServer's PostgreSQL JOIN implementation, present through 8.6.4, lets an attacker who can influence the JOIN FROM source-layer attribute rewrite the generated WHERE predicate and pull unintended rows out of the configured PostgreSQL join table. Exposure is conditional: MapServer must be built with PostgreSQL/PostGIS support (USE_POSTGIS) and a mapfile must define a JOIN with CONNECTIONTYPE POSTGRESQL, and the attacker must be able to taint the source feature attribute that the join reuses. A public proof-of-concept reproduction is published in the GitHub security advisory, but the issue is not in CISA KEV and no EPSS score was supplied; the vendor fixed it in MapServer 8.6.5.
RemediationAI
Upgrade to MapServer 8.6.5, which is the vendor-released fix referenced by the rel-8-6-5 release tag and the advisory GHSA-m3xh-ccmh-x8rw; the changes land in commits 05babb88314b8f022eb47a3ab1a00eb37f92085f and a39a299a03a767dd966bb40caf044539e7813bce (pull requests 7546 and 7566), which replace the string-concatenated FROM value with a PQescapeStringConn()-escaped parameter and quote the join table/column identifiers. If upgrading cannot be done immediately, remove or disable JOIN blocks that use CONNECTIONTYPE POSTGRESQL - this eliminates the injection path but also removes the join-derived attributes from MapServer output - and stop accepting untrusted source layers whose attributes feed JOIN FROM, since the payload is stored in that data and replayed later, meaning input validation must cover imported shapefiles/DBFs and any other writable source layer rather than only HTTP request parameters. Additionally, give the PostgreSQL connection used by the JOIN a least-privilege role limited to SELECT on the intended join table, which caps how much data an altered predicate can reach but does not prevent predicate tampering, and avoid rendering JOIN attributes into public templates where disclosure of unintended rows would be visible to the requester.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw is CWE-89 (improper neutralization of special elements in an SQL command) and is second-order: in src/mappostgresql.c, msPOSTGRESQLJoinPrepare() copies the source layer attribute named by JOIN FROM into joininfo->from_value, and msPOSTGRESQLJoinNext() later builds a query with snprintf(sql, nSize, "SELECT %s FROM %s WHERE %s = '%s'", columns, join->table, join->to, joininfo->from_value) and runs it through PQexec() with no parameterization or escaping. A payload such as x'OR'1'='1 stored in a source attribute (for example a shapefile DBF field referenced by JOIN FROM) therefore becomes SQL syntax when JOIN processing is triggered by a request such as a CGI indexquery, allowing the intended WHERE id = '<value>' condition to be altered. The fix introduces msPOSTGRESQLEscapeSQLParam(), which wraps PQescapeStringConn() around the FROM value, and factors out msDefaultEscapePropertyName() to quote identifiers such as the join table, the TO column and the selected columns. The assessed vector scores the vulnerable MapServer system as C:N/I:N/A:N with subsequent-system impact C:L/I:L, consistent with the injection being bounded to data readable through the configured join connection rather than arbitrary database or host compromise; the trigger path and prerequisites, not the SQL syntax alone, are what limit practical exploitation.
Know when Mapserver gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Second-order injection requires an attacker-controlled value to already be stored in the source attribute, so AC:H; request is unauthenticated (PR:N); the injected query hits a separate PostgreSQL component (S:C) with limited data disclosure/logic alteration (C:L/I:L, A:N).
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
2DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
MapServer is a system for developing web-based GIS applications. Rated high severity (CVSS 8.9), this vulnerability is r
Stack-based buffer overflow in MapServer before 6.0.6, 6.2.x before 6.2.4, 6.4.x before 6.4.5, and 7.0.x before 7.0.4 al
Unauthenticated SQL injection in MapServer 8.4.0 through 8.6.3 lets remote attackers who can reach a PostGIS-backed quer
In MapServer before 7.0.3, OGR driver error messages are too verbose and may leak sensitive information if data connecti
Denial of service in MapServer 6.4.0 through 8.6.2 allows remote unauthenticated attackers to crash the server by submit
SQL injection vulnerability in the msPostGISLayerSetTimeFilter function in mappostgis.c in MapServer before 6.4.1, when
Reflected cross-site scripting in MapServer's WMS OpenLayers viewer output (FORMAT=application/openlayers or template=op
Reflected XSS in MapServer 6.0 through 8.6.1 allows unauthenticated remote attackers to inject arbitrary HTML and JavaSc
Reflected cross-site scripting in MapServer's OGC API Features HTML output lets an attacker run arbitrary JavaScript und
Reflected cross-site scripting (CWE-79) in MapServer's OpenLayers HTML output affects versions 6.0 through 8.6.3 and is
MapServer versions 4.2 through 8.6.0 are vulnerable to a heap buffer overflow in the SLD (Styled Layer Descriptor) parse
MapServer before 7.0.8, 7.1.x and 7.2.x before 7.2.3, 7.3.x and 7.4.x before 7.4.5, and 7.5.x and 7.6.x before 7.6.3 doe
EUVD-2026-131828
NVD
CVE.org
EPSS
GitHub
VulDB
Exploit-DB