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

- **Severity:** HIGH 8.6
- **CVSS:** 8.6 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: Low; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.96% (percentile 60, 2026-11-28)
- **CWE:** CWE-787
- **Published:** 2026-11-20T19:09:20.128Z
- **Modified:** 2026-11-24T17:54:52.597Z

## Who should check

- Anyone running MapServer \< 8.6.5

## Description

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.

## Affected and fixed versions

- MapServer: \< 8.6.5 (cvelist)

## Mitigation

- Upgrade MapServer to 8.6.5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-77326. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-77326.md
Affected: MapServer < 8.6.5
Fixed in: MapServer 8.6.5

Steps:
1. Search this machine and project for MapServer: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-77326 being exploited?

There is no confirmed exploitation: CVE-2026-77326 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.96% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2026-77326?

High: CVSS 8.6 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2026-77326?

MapServer \< 8.6.5.

### Is there a fix for CVE-2026-77326?

Yes. Fixed in MapServer 8.6.5. Upgrade MapServer to 8.6.5 or later.

### How do I check if I'm affected by CVE-2026-77326?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/MapServer/MapServer/security/advisories/GHSA-4mwc-qc95-5959>
- patch: <https://github.com/MapServer/MapServer/pull/7555>
- patch: <https://github.com/MapServer/MapServer/pull/7569>
- patch: <https://github.com/MapServer/MapServer/commit/a7d5eb844a59ea076b7972a018753242f18e6f7b>
- patch: <https://github.com/MapServer/MapServer/commit/ea1d87a6d45bbe5814a545a8b4d6a5e6b6842ea8>
- other: <https://github.com/MapServer/MapServer/releases/tag/rel-8-6-5>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-77326>
- FIRST EPSS: EPSS scores by FIRST <https://www.first.org/epss/>

HTML: <https://flawdb.com/CVE-2026-77326> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-77326>
