Loading...
Skip to main content

CVE-2026-48502 — Vulnerability in MessagePack — CVE Details

HIGH

MessagePack-CSharp: Denial of service vulnerabilities can swamp the CPU or crash the process with stack and heap overflows

Published June 25, 2026Updated June 25, 2026Source: osv

Summary

## Summary `MessagePackReader.ReadDateTime()` can allocate stack memory based on an attacker-controlled MessagePack extension length. In the slow path for timestamp extension parsing, the computed `tokenSize` includes the extension body length from the wire and is used in a `stackalloc` operation before the extension length is validated as one of the valid timestamp sizes. A very small payload can claim a large timestamp extension body and cause a stack allocation large enough to trigger an uncatchable `StackOverflowException`, terminating the host process. ## Impact Applications are affected when they deserialize untrusted payloads into types containing `DateTime` values. This path is available through the standard formatter set and does not require opting into typeless serialization, LZ4 compression, Unity-specific resolvers, or other specialized features. `MessagePackSecurity.UntrustedData` and `MaximumObjectGraphDepth` do not mitigate this issue because the crash is caused by a single-frame stack allocation, not by object graph recursion. An attacker can send a MessagePack timestamp extension header with an oversized body length and insufficient body bytes. The reader enters the slow path, attempts to stack-allocate a buffer sized from that declared length, and can terminate the process before a catchable serialization exception is thrown. ## Affected components - Package: `MessagePack` - API: `MessagePackReader.ReadDateTime` - Data types: `DateTime` and formatter paths that call `ReadDateTime` - Finding IDs: `MESSAGEPACKCSHARP-020`, related stack allocation finding `MESSAGEPACKCSHARP-CROW-MEM-001` ## 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 timestamp extension lengths before any stack allocation. Valid MessagePack timestamp payload lengths are limited to the supported timestamp encodings, so oversized extension lengths should fail with a catchable MessagePack serialization exception before the slow path allocates a buffer. ## Workarounds Patching is recommended. Until a patched version is available, avoid deserializing untrusted MessagePack payloads into schemas that contain `DateTime` or `DateTimeOffset` values. Where possible, enforce strict maximum message sizes and reject malformed extension payloads before they reach MessagePack-CSharp. There is no complete workaround for applications that must deserialize attacker-controlled MessagePack data containing date/time fields with affected versions. ## Resources - `MESSAGEPACKCSHARP-020`: `ReadDateTime` stack allocation from attacker-controlled extension length - `MESSAGEPACKCSHARP-CROW-MEM-001`: related attacker-controlled stack allocation finding in `MessagePackReader` - CWE-770: Allocation of Resources Without Limits or Throttling ## CVE split rationale This vulnerability is independently fixable in the DateTime extension parsing path by validating extension lengths before stack allocation. It is separate from recursive stack overflows, LZ4 issues, and collection allocation bugs.

Advisory Timeline

  • First published June 25, 2026 (109 days ago).
  • Last revised June 25, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

NuGet
Update MessagePack to 3.1.7 or later
dotnet add package MessagePack --version 3.1.7

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: nuget (1).

PackageEcosystemAffectedFixed In
MessagePack
nuget
3.0.111-alpha, 3.0.129-beta, 3.0.134-beta, 3.0.208-rc-0001 (+11 more)3.1.7

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 5.6 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
—
Confidentiality
—
Integrity
—
Availability
—

CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Frequently Asked Questions

What is CVE-2026-48502?
MessagePack-CSharp: Denial of service vulnerabilities can swamp the CPU or crash the process with stack and heap overflows This vulnerability has been assigned a severity rating of HIGH (CVSS score: 5.6/10).
How do I check if my project is affected by CVE-2026-48502?
CVE-2026-48502 affects MessagePack. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-48502 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
5.6

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

Also Known As

GHSA-382j-8mxh-c7x2

Related CVEs

  • CVE-2026-106112
    HIGH

    ImageSharp: ICC LUT16 output channel count can write beyond Vector4

  • CVE-2026-48109
    HIGH

    MessagePack's LZ4 decompression may fail with AccessViolationException after dereferencing memory from bad input

  • CVE-2026-106115
    HIGH

    ImageSharp: TIFF CCITT T6 encoder writes beyond an undersized output buffer

  • CVE-2026-48506
    HIGH

    MessagePack-CSharp: MessagePackReader.Skip can recurse without enforcing maximum object graph depth

  • CVE-2026-48509
    MEDIUM

    MessagePack-CSharp: ASP.NET Core MessagePackInputFormatter defaults to TrustedData for HTTP request bodies

  • CVE-2026-48511
    MEDIUM

    MessagePack-CSharp: ExpandoObject formatter can perform quadratic insertion work on untrusted maps

  • CVE-2020-5234
    MEDIUM

    Untrusted data can lead to DoS attack due to hash collisions and stack overflow in MessagePack

  • CVE-2026-48510
    MEDIUM

    MessagePack-CSharp: LZ4 decompression allocates from unbounded declared output lengths

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies