GHSA-cxmj-83gh-fp49

Suggest an improvement
Source
https://github.com/advisories/GHSA-cxmj-83gh-fp49
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/06/GHSA-cxmj-83gh-fp49/GHSA-cxmj-83gh-fp49.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-cxmj-83gh-fp49
Aliases
Downstream
Published
2026-06-25T21:26:43Z
Modified
2026-06-25T21:41:30Z
Severity
  • 6.3 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N CVSS Calculator
Summary
MessagePack-CSharp: Multi-dimensional array formatters allocate from unchecked dimensions
Details

Summary

MessagePack-CSharp's multi-dimensional array formatters read dimension lengths directly from the payload and allocate T[,], T[,,], or T[,,,] before validating that the dimension product matches the encoded element count.

The formatter reads a guarded element array header, but allocation of the target multi-dimensional array happens before the dimensions are checked against that element count. A small payload can therefore declare large dimensions, provide an empty or tiny inner array, and cause a large heap allocation before element data is validated.

Impact

Applications are affected when they deserialize untrusted MessagePack payloads into models containing multi-dimensional arrays such as T[,], T[,,], or T[,,,].

An attacker can encode large dimension integers and a small guarded element array. The formatter allocates the target array from the dimensions before confirming that the product of dimensions is consistent with the element count.

The result can be out-of-memory exceptions, container termination on memory-constrained hosts, large object heap pressure, or severe CPU cost from zero-initializing oversized arrays. MessagePackSecurity.UntrustedData does not provide a general allocation cap for this path.

Affected components

  • Package: MessagePack
  • APIs: TwoDimensionalArrayFormatter<T>.Deserialize, ThreeDimensionalArrayFormatter<T>.Deserialize, FourDimensionalArrayFormatter<T>.Deserialize
  • Data shapes: T[,], T[,,], and T[,,,]
  • Finding IDs: MESSAGEPACKCSHARP-040, duplicate/open variant MESSAGEPACKCSHARP-OPEN-003

Patches

Fixes are prepared and will be released in coordinated patch versions.

Upgrade guidance:

  1. Upgrade MessagePack to the patched version for your release line.
  2. Upgrade companion MessagePack packages in the same dependency graph to the coordinated patched versions.

The fix should validate dimensions before allocation. Dimension values should be non-negative, their checked product should match the encoded element count, and the product should be bounded by the available payload and any configured security limits before new T[...] is executed.

Workarounds

Patching is recommended.

Until a patched version is available, avoid deserializing untrusted payloads into schemas containing multi-dimensional arrays. Prefer schema shapes that can be validated before allocation, such as bounded lists, dictionaries with application-level count limits, or jagged arrays with application-level limits.

Message-size limits reduce the blast radius but do not fully address allocation amplification where a small payload can encode disproportionate array dimensions.

Resources

  • MESSAGEPACKCSHARP-040: unchecked multi-dimensional array dimensions
  • MESSAGEPACKCSHARP-OPEN-003: duplicate/open finding for the multi-dimensional array issue
  • CWE-770: Allocation of Resources Without Limits or Throttling
Database specific
{
    "cwe_ids":  [
        "CWE-770"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-06-25T21:26:43Z",
    "nvd_published_at":  "2026-06-22T22:16:48Z",
    "severity":  "MODERATE"
}
References

Affected packages

NuGet / MessagePack

Package

Name
MessagePack
View open source insights on deps.dev
Purl
pkg:nuget/MessagePack

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.5.301

Affected versions

0.*
0.1.0-beta
0.2.0-beta
0.2.1-beta
0.2.2-beta
0.2.3-beta
0.3.0-beta
0.4.0
0.4.1
0.4.2
0.5.0
0.6.0
0.6.1
0.7.0
0.7.2
0.8.0
0.8.1
0.8.2
0.8.3
0.8.4
0.8.5
1.*
1.0.0
1.0.1
1.0.2
1.0.3
1.1.0
1.1.1
1.1.1.1
1.1.2
1.2.0
1.2.0.1
1.2.0.2
1.2.1
1.2.2
1.2.3
1.3.0
1.3.1
1.3.1.1
1.3.2
1.3.3
1.4.0
1.4.1
1.4.2
1.4.3
1.4.4
1.5.0
1.5.0.1
1.5.0.2
1.5.1
1.6.0
1.6.0.1
1.6.0.2
1.6.0.3
1.6.1
1.6.1.1
1.6.1.2
1.6.2
1.7.0
1.7.1
1.7.2
1.7.3
1.7.3.1
1.7.3.2
1.7.3.3
1.7.3.4
1.7.3.7
1.8.71-beta
1.8.74
1.8.80
1.9.3-g129239b107
1.9.3
1.9.11
2.*
2.0.107-alpha
2.0.108-alpha
2.0.110-alpha
2.0.110-alpha-g1e44a9106f
2.0.119-beta
2.0.123-beta
2.0.171-beta
2.0.204-beta
2.0.221-beta
2.0.231-rc
2.0.270-rc
2.0.299-rc
2.0.323
2.0.335
2.1.80
2.1.90
2.1.115
2.1.143
2.1.152
2.1.165
2.1.194
2.2.36-alpha
2.2.44-rc
2.2.60
2.2.85
2.2.113
2.3.58-alpha
2.3.73-alpha
2.3.75
2.3.85
2.3.112
2.4.14-alpha
2.4.23-alpha
2.4.35
2.4.59
2.5.64-alpha
2.5.94
2.5.103
2.5.108
2.5.124
2.5.129
2.5.140
2.5.168
2.5.171
2.5.172
2.5.187
2.5.192
2.5.198
2.5.205

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/06/GHSA-cxmj-83gh-fp49/GHSA-cxmj-83gh-fp49.json"

NuGet / MessagePack

Package

Name
MessagePack
View open source insights on deps.dev
Purl
pkg:nuget/MessagePack

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.0
Fixed
3.1.7

Affected versions

3.*
3.0.3
3.0.54-alpha
3.0.111-alpha
3.0.129-beta
3.0.134-beta
3.0.208-rc-0001
3.0.300
3.0.308
3.1.0
3.1.1
3.1.2
3.1.3
3.1.4
3.1.5
3.1.6

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/06/GHSA-cxmj-83gh-fp49/GHSA-cxmj-83gh-fp49.json"