Skip to content

[Backport branch-8-6] Fix WCS 2.0 GetCoverage DoS from non-positive RESOLUTION (GHSA-6jr5-rc9c-p3cj) - #7589

Merged
jmckenna merged 2 commits into
branch-8-6from
backport-7575-to-branch-8-6
Aug 3, 2026
Merged

[Backport branch-8-6] Fix WCS 2.0 GetCoverage DoS from non-positive RESOLUTION (GHSA-6jr5-rc9c-p3cj)#7589
jmckenna merged 2 commits into
branch-8-6from
backport-7575-to-branch-8-6

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Backport #7575
Authored by: @sdjasj

秦至 and others added 2 commits August 3, 2026 13:46
…c9c-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)
@jmckenna
jmckenna merged commit 244b6b1 into branch-8-6 Aug 3, 2026
34 checks passed
@jmckenna
jmckenna deleted the backport-7575-to-branch-8-6 branch August 3, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant