[mapserver-commits] [MapServer/MapServer] 6cccc5: Fix WCS 2.0 GetCoverage DoS from non-positive RESO...

github-actions[bot] noreply at github.com
Mon Aug 3 06:46:32 PDT 2026


  Branch: refs/heads/backport-7575-to-branch-8-6
  Home:   https://github.com/MapServer/MapServer
  Commit: 6cccc5ac00bdc8e36b36393fb4ef1e49dcdb9189
      https://github.com/MapServer/MapServer/commit/6cccc5ac00bdc8e36b36393fb4ef1e49dcdb9189
  Author: 秦至 <yz534720 at antgroup.com>
  Date:   2026-08-03 (Mon, 03 Aug 2026)

  Changed paths:
    M HISTORY.md
    A msautotest/wxs/expected/wcs_20_exception_neg_resolution.xml
    A msautotest/wxs/expected/wcs_20_exception_zero_resolution.xml
    M msautotest/wxs/wcs_simple.map
    M src/mapwcs20.cpp

  Log Message:
  -----------
  Fix WCS 2.0 GetCoverage DoS from non-positive RESOLUTION (GHSA-6jr5-rc9c-p3cj)

An unauthenticated, remotely reachable denial-of-service vulnerability
exists in MapServer's WCS 2.0 GetCoverage path. The parser accepts any
RESOLUTION value that parses as a double — including negative, zero, and
nan — without a > 0 / finiteness check. The resulting negative image
dimensions are then cast to size_t (huge value) inside
msSmallMalloc()/msSmallCalloc(). Allocation fails, and MapServer's
"safe" allocator terminates the process via exit(1). A single crafted
request kills the handling CGI/FastCGI worker.

Fix:
1. msWCSParseResolutionString20(): After parsing, reject non-finite
   values and values <= 0 with InvalidParameterValue. This mirrors the
   existing validation in msWCSParseScaleString20() which already
   rejects scale <= 0.
2. msWCSGetCoverage20(): Add a defensive guard that rejects width <= 0
   or height <= 0 before the existing MAXSIZE check. This catches any
   edge case where a non-positive dimension reaches this point.

Tests added in msautotest/wxs/wcs_simple.map:
- Negative RESOLUTION → InvalidParameterValue (was exit(1))
- Zero RESOLUTION → InvalidParameterValue (was raw alloc error)



To unsubscribe from these emails, change your notification settings at https://github.com/MapServer/MapServer/settings/notifications


More information about the MapServer-commits mailing list