# CVE-2026-77328: MapServer: PostgreSQL JOIN second-order SQL injection in src/mappostgresql.c

Status: published. Published: 2026-11-20. Updated: 2026-11-25.

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.

## Remediation

- fix: MapServer JOIN with PostgreSQL: GitHub reports patched versions 8.6.5. Check the advisory for the affected release branch. (source: GitHub GHSA-m3xh-ccmh-x8rw) — https://github.com/MapServer/MapServer/security/advisories/GHSA-m3xh-ccmh-x8rw

## Affected products and versions

- MapServer / MapServer: < 8.6.5 (affected). Source: CNA: GitHub_M
-  / MapServer JOIN with PostgreSQL (MapServer JOIN with PostgreSQL): <= 8.6.4 (affected, GitHub advisory range). Source: GitHub GHSA-m3xh-ccmh-x8rw

## Severity and prioritization

- CVSS 4.0: 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; source: CNA: GitHub_M

- CVSS 4.0: 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X; source: NVD: security-advisories@github.com

- CISA KEV: No listing in collected sources

- EPSS: 0.77% as of 2026-11-24; percentile 56.42%

- SSVC: exploitation poc; automatable yes; technical impact total; source ADP: CISA-ADP

- Weaknesses: CWE-89

## Exploit evidence

- exploit: https://github.com/MapServer/MapServer/security/advisories/GHSA-m3xh-ccmh-x8rw (ADP: CISA-ADP)

## References

- https://github.com/MapServer/MapServer/security/advisories/GHSA-m3xh-ccmh-x8rw (CNA: GitHub_M; x_refsource_CONFIRM)

- https://github.com/MapServer/MapServer/pull/7546 (CNA: GitHub_M; x_refsource_MISC)

- https://github.com/MapServer/MapServer/pull/7566 (CNA: GitHub_M; x_refsource_MISC)

- https://github.com/MapServer/MapServer/commit/05babb88314b8f022eb47a3ab1a00eb37f92085f (CNA: GitHub_M; x_refsource_MISC)

- https://github.com/MapServer/MapServer/commit/a39a299a03a767dd966bb40caf044539e7813bce (CNA: GitHub_M; x_refsource_MISC)

- https://github.com/MapServer/MapServer/releases/tag/rel-8-6-5 (CNA: GitHub_M; x_refsource_MISC)

- https://github.com/MapServer/MapServer/security/advisories/GHSA-m3xh-ccmh-x8rw (ADP: CISA-ADP; exploit)

- https://github.com/MapServer/MapServer/commit/05babb88314b8f022eb47a3ab1a00eb37f92085f (security-advisories@github.com)

- https://github.com/MapServer/MapServer/commit/a39a299a03a767dd966bb40caf044539e7813bce (security-advisories@github.com)

- https://github.com/MapServer/MapServer/pull/7546 (security-advisories@github.com)

- https://github.com/MapServer/MapServer/pull/7566 (security-advisories@github.com)

- https://github.com/MapServer/MapServer/releases/tag/rel-8-6-5 (security-advisories@github.com)

- https://github.com/MapServer/MapServer/security/advisories/GHSA-m3xh-ccmh-x8rw (security-advisories@github.com)

- https://github.com/MapServer/MapServer/security/advisories/GHSA-m3xh-ccmh-x8rw (134c704f-9b21-4f2e-91b3-4a467353bcc0)

- https://github.com/MapServer/MapServer/security/advisories/GHSA-m3xh-ccmh-x8rw (GitHub Security Advisories; advisory)

## Provenance

- CNA: GitHub_M: https://www.cve.org/CVERecord?id=CVE-2026-77328; retrieved 2026-11-25; source updated 2026-11-25

- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-77328; retrieved 2026-11-25; source updated 2026-11-25

- GitHub Security Advisories: https://github.com/MapServer/MapServer/security/advisories/GHSA-m3xh-ccmh-x8rw; retrieved 2026-11-22; source updated 2026-08-20

- FIRST EPSS: https://api.first.org/data/v1/epss?cve=CVE-2026-77328; retrieved 2026-11-25; source updated Not reported

Revision: 6e7fb890e761eb170d754c3b28dedd22991da9b511ff77d243c4c26c3abec36a

Canonical: https://y2.dev/cve/CVE-2026-77328

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.