# CVE-2026-45104: MapServer NULL pointer dereference in SLD ElseFilter parsing

Source: https://junglewise.ai/threats/cve-2026-45104-mapserver-null-pointer-dereference-in-sld-elsefilter-parsing  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-27. Updated: 2026-05-27  
License: CC BY 4.0 with a link back

CVE-2026-45104 · Severity: high · CVSS 7.5 · Published 2026-05-27

MapServer, a popular open-source platform for publishing spatial data and interactive mapping applications, is vulnerable to a remote denial-of-service attack. An unauthenticated attacker can send a specially crafted, small mapping style request (SLD) to a MapServer web service, causing the application to crash. This can lead to service outages, particularly in environments where MapServer handles multiple requests simultaneously.

Technologies: [MapServer](https://junglewise.ai/threats/technologies/mapserver). Vendors: [MapServer](https://junglewise.ai/threats/vendors/mapserver).

## Quick answers

**Is CVE-2026-45104 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-45104 being exploited in the wild.

**How severe is CVE-2026-45104?** High severity, with a CVSS score of 7.5, published 27 May 2026.

**Which products and versions are affected?** MapServer 6.4.0 to 8.6.2.

**Is there a fix for CVE-2026-45104?** A patch was published on 2026-05-27: Fixed in version 8.6.3 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-45104 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-45104?** Check whether you run MapServer at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A NULL pointer dereference exists in MapServer's SLD parsing logic within `src/mapogcsld.cpp`. The function `msSLDParseUserStyle` incorrectly assumes that any `<Rule>` containing an `<ElseFilter/>` will result in the creation of exactly one new class via `msSLDParseRule`. However, if the rule contains no symbolizers (which is structurally valid SLD), `msSLDParseRule` adds zero classes. Subsequent logic in `_SLDApplyRuleValues` then attempts to index `psLayer->_class` with a value of -1, causing a crash. This is reachable unauthenticated via the WMS `SLD_BODY` or `SLD` parameters, which are enabled by default. The vulnerability is fixed in version 8.6.3 by calculating the actual number of classes added rather than assuming a constant value.

## Affected products

- MapServer MapServer 6.4.0 to 8.6.2

## Timeline

- 2026-05-07: advisory: GitHub Security Advisory published
- 2026-05-27: disclosed: CVE published to NVD
- 2026-05-27: patched: Fixed in version 8.6.3

## References

- [https://github.com/MapServer/MapServer/security/advisories/GHSA-4h8g-378q-r75m](https://github.com/MapServer/MapServer/security/advisories/GHSA-4h8g-378q-r75m)

## Related threats

- [MapServer PostGIS SQL injection via numeric filter bypass](https://junglewise.ai/threats/cve-2026-54354-mapserver-postgis-sql-injection-via-numeric-filter-bypass)
- [MapServer reflected XSS in WMS server SRS parameter](https://junglewise.ai/threats/cve-2026-42030-mapserver-reflected-xss-in-wms-server-srs-parameter)
