Skip to main content

MapServer EUVDEUVD-2026-131828

| CVE-2026-77328 MEDIUM
SQL Injection (CWE-89)
2026-11-20 security-advisories@github.com
6.9
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Store SQL payload in source layer attribute (JOIN FROM key)
  2. Delivery
    Send map request triggering PostgreSQL JOIN
  3. Exploit
    from_value embedded unescaped into PQexec query
  4. Execution
    Injected quotes alter WHERE predicate
  5. Impact
    Unintended 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.8% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

MapServer < 8.6.5

Affected Packages

euvd mapserver fix: 8.6.5

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

Vendor (github) PRIMARY 6.9 MEDIUM
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
vuln.today AI 5.4 MEDIUM

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).

3.1 AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Nov 20, 2026 - 21:04 EUVD
CVE Published
Nov 20, 2026 - 19:18 cve.org
MEDIUM 6.9

DescriptionCVE.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

EPSS Score
0.8%
Top 43% exploitable
Prevalence
Medium
popular open-source GIS web server, scoped to geospatial deployments with PostgreSQL JOIN enabled
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.8%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

35
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

CVE-2025-59431 HIGH POC
8.9 Sep 19

MapServer is a system for developing web-based GIS applications. Rated high severity (CVSS 8.9), this vulnerability is r

CVE-2017-5522 CRITICAL
9.8 Mar 15

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

CVE-2026-54354 HIGH
8.2 Sep 17

Unauthenticated SQL injection in MapServer 8.4.0 through 8.6.3 lets remote attackers who can reach a PostGIS-backed quer

CVE-2016-9839 HIGH
7.5 Dec 08

In MapServer before 7.0.3, OGR driver error messages are too verbose and may leak sensitive information if data connecti

CVE-2026-45104 HIGH
7.5 May 27

Denial of service in MapServer 6.4.0 through 8.6.2 allows remote unauthenticated attackers to crash the server by submit

CVE-2013-7262 MEDIUM
6.8 Jan 05

SQL injection vulnerability in the msPostGISLayerSetTimeFilter function in mappostgis.c in MapServer before 6.4.1, when

CVE-2026-77325 MEDIUM
6.1 Nov 20

Reflected cross-site scripting in MapServer's WMS OpenLayers viewer output (FORMAT=application/openlayers or template=op

CVE-2026-42030 MEDIUM
6.1 May 08

Reflected XSS in MapServer 6.0 through 8.6.1 allows unauthenticated remote attackers to inject arbitrary HTML and JavaSc

CVE-2026-77323 MEDIUM
5.3 Nov 20

Reflected cross-site scripting in MapServer's OGC API Features HTML output lets an attacker run arbitrary JavaScript und

CVE-2026-54355 MEDIUM
5.3 Sep 17

Reflected cross-site scripting (CWE-79) in MapServer's OpenLayers HTML output affects versions 6.0 through 8.6.3 and is

CVE-2026-33721 MEDIUM
5.3 Mar 27

MapServer versions 4.2 through 8.6.0 are vulnerable to a heap buffer overflow in the SLD (Styled Layer Descriptor) parse

CVE-2021-32062 MEDIUM
5.3 May 06

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

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy