# CVE-2026-77326: MapServer: Heap buffer overflow in WMS GetLegendGraphic via repeated LAYER parameters

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

MapServer is a system for developing web-based GIS applications. From 8.2.0 until 8.6.5, an unauthenticated attacker can send a WMS GetLegendGraphic request with a nonempty BBOX and repeated LAYER parameters to trigger a heap buffer overflow in msWMSDispatch() in src/mapwms.cpp. The handler appends synthesized entries to cgiRequestObj.ParamNames and cgiRequestObj.ParamValues at NumParams without retaining the arrays' capacity or reallocating them, while incrementing NumParams inside the loop. Once the parser's hidden capacity is exhausted, the writes pass the heap allocation boundary. A single request can corrupt heap memory and crash the process; code execution may be possible but was not demonstrated. This issue is fixed in version 8.6.5.

## Remediation

- fix: WMS support in MapServer: GitHub reports patched versions 8.6.5. Check the advisory for the affected release branch. (source: GitHub GHSA-4mwc-qc95-5959) — https://github.com/MapServer/MapServer/security/advisories/GHSA-4mwc-qc95-5959

## Affected products and versions

- MapServer / MapServer: < 8.6.5 (affected). Source: CNA: GitHub_M
-  / WMS support in MapServer (WMS support in MapServer): <= 8.6.4 (affected, GitHub advisory range). Source: GitHub GHSA-4mwc-qc95-5959

## Severity and prioritization

- CVSS 3.1: 8.6 (high); CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H; source: CNA: GitHub_M

- CVSS 3.1: 8.6 (high); CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H; source: NVD: security-advisories@github.com

- CISA KEV: No listing in collected sources

- EPSS: 0.96% as of 2026-11-23; percentile 62.31%

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

- Weaknesses: CWE-787

## Exploit evidence

- exploit: https://github.com/MapServer/MapServer/security/advisories/GHSA-4mwc-qc95-5959 (ADP: CISA-ADP)

## References

- https://github.com/MapServer/MapServer/security/advisories/GHSA-4mwc-qc95-5959 (CNA: GitHub_M; x_refsource_CONFIRM)

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

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

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

- https://github.com/MapServer/MapServer/commit/ea1d87a6d45bbe5814a545a8b4d6a5e6b6842ea8 (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-4mwc-qc95-5959 (ADP: CISA-ADP; exploit)

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

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

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

- https://github.com/MapServer/MapServer/pull/7569 (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-4mwc-qc95-5959 (security-advisories@github.com)

- https://github.com/MapServer/MapServer/security/advisories/GHSA-4mwc-qc95-5959 (134c704f-9b21-4f2e-91b3-4a467353bcc0)

- https://github.com/MapServer/MapServer/security/advisories/GHSA-4mwc-qc95-5959 (GitHub Security Advisories; advisory)

## Provenance

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

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

- GitHub Security Advisories: https://github.com/MapServer/MapServer/security/advisories/GHSA-4mwc-qc95-5959; retrieved 2026-11-22; source updated 2026-08-20

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

Revision: a144909bae5071916d55ee9a9bd6bf8c9ff95b75e61fb044b09ccf474ee7c71b

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

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