MapServer: Reflected XSS in WMS OpenLayers output via the `X-Forwarded-Host` header
MapServer
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| MapServer MapServer |
| No fix yet |
Original description
MapServer is a system for developing web-based GIS applications. From 6.0 until 8.6.5, MapServer's WMS OpenLayers output, selected by FORMAT=application/openlayers or template=openlayers, substitutes a request-derived online-resource value into a single-quoted JavaScript string in src/maptemplate.c. The prior remediation for GHSA-xqj6-vjqr-33vv used msEscapeJSonLikeString() to protect the JavaScript string but did not neutralize angle brackets, so attacker-controlled X-Forwarded-Host or X-Forwarded-Proto values can still terminate the script element at the HTML parser layer. Deployments that expose attacker-controlled PATH_INFO or map= values reaching the same string are also affected. An unauthenticated attacker can cause arbitrary JavaScript to execute in a victim's browser under the MapServer origin when the victim loads the crafted output. This issue is fixed in version 8.6.5.
From the CVE record · GitHub_M
References
- github.com/MapServer/MapServer/security/advisories/GHSA-52rr-p4x5-2x6x
- github.com/MapServer/MapServer/pull/7544
- github.com/MapServer/MapServer/pull/7554
- github.com/MapServer/MapServer/commit/2e4229ff66f6eac1b270755a0ce0ce8debee4432
- github.com/MapServer/MapServer/commit/57a5d592a4270137c20f33459d59d370b5374426
- github.com/MapServer/MapServer/releases/tag/rel-8-6-5