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

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


  Branch: refs/heads/branch-8-6
  Home:   https://github.com/MapServer/MapServer
  Commit: 244b6b17e57b924681e0eb71a55d0eb6e657b091
      https://github.com/MapServer/MapServer/commit/244b6b17e57b924681e0eb71a55d0eb6e657b091
  Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  Date:   2026-08-03 (Mon, 03 Aug 2026)

  Changed paths:
    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) (#7589)

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)

Co-authored-by: 秦至 <yz534720 at antgroup.com>
Co-authored-by: Jeff McKenna <jmckenna at gatewaygeomatics.com>



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