CVE-2026-48506: MessagePack for C# Recursive Bypass Denial of Service
MessagePack for C# versions before 2.5.301 and 3.1.7 contain a flaw in the TrySkip() function that allows deeply nested data structures to bypass the library's built-in depth-checking protection. When the serializer encounters data it needs to skip—such as unknown fields or unrecognized map keys—it recursively processes nested structures without respecting the configured maximum object graph depth limit. An attacker who sends a specially crafted MessagePack payload with extreme nesting can trigger an unrecoverable stack overflow, causing the application to crash. This is a denial-of-service vulnerability affecting any .NET application using vulnerable versions of MessagePack.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Weaknesses (CWE)
- CWE-674
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-22 / 2026-06-23
NVD description (verbatim)
MessagePack for C# is a MessagePack serializer for C#. Prior to 2.5.301 and 3.1.7, MessagePackReader.TrySkip() recursively descends into nested arrays and maps without incrementing the reader depth or calling the configured depth checks. This bypasses MessagePackSecurity.MaximumObjectGraphDepth, the library's documented protection against deeply nested object graphs. Many generated and dynamic formatters call reader.Skip() when they encounter unknown map keys, unknown array members, ignored fields, or data that should be skipped for forward compatibility. A deeply nested value in one of these skipped positions can therefore cause unbounded recursion and an uncatchable StackOverflowException. This vulnerability is fixed in 2.5.301 and 3.1.7.
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in MessagePackReader.TrySkip(), which recursively descends into nested arrays and maps during serialization without incrementing the reader's internal depth counter or invoking the configured depth validation checks that normally prevent unbounded nesting (MessagePackSecurity.MaximumObjectGraphDepth). Generated and dynamic formatters call reader.Skip() when handling unknown map keys, unknown array elements, ignored fields, or forward-compatibility scenarios. Because these skip operations bypass depth validation, a malicious payload containing deeply nested structures in skipped positions can cause unbounded recursion that ultimately raises an uncatchable StackOverflowException. The flaw is rooted in incomplete implementation of recursive depth tracking across all code paths that traverse object graphs.
Business impact
Applications relying on MessagePack for C# to deserialize untrusted network data are vulnerable to remote denial of service. An unauthenticated attacker can crash a service by sending a single malicious payload, leading to unavailability, disrupted business operations, and potential cascading failures in microservice architectures that depend on reliable serialization. The fix is straightforward and low-risk, making rapid patching the clear priority. Organizations processing MessagePack data from external sources face elevated risk until patched.
Affected systems
MessagePack for C# versions prior to 2.5.301 (2.x branch) and prior to 3.1.7 (3.x branch) are affected. Any .NET Framework, .NET Core, or .NET 5+ application that deserializes untrusted MessagePack data using these versions is in scope. The vulnerability is especially critical in services that accept MessagePack input from the network (APIs, message queues, IoT endpoints) without strict upstream validation.
Exploitability
Exploitability is high. The vulnerability requires no authentication, no user interaction, and no special configuration—only a network path to send a malicious MessagePack payload to the vulnerable service. The CVSS vector (AV:N/AC:L/PR:N/UI:N) reflects this ease of exploitation. Constructing a deeply nested payload is trivial for an attacker with basic knowledge of the MessagePack format. No privileged access, special tooling, or complex social engineering is needed.
Remediation
Upgrade MessagePack for C# to version 2.5.301 or later (if on the 2.x branch) or version 3.1.7 or later (if on the 3.x branch). Both versions restore proper depth tracking in TrySkip() and re-enable the MaximumObjectGraphDepth protection. Verify the patch is deployed across all services consuming MessagePack data. No configuration changes or application code modifications are required; the fix is transparent and backward-compatible.
Patch guidance
1. Identify all projects in your environment referencing the MessagePack NuGet package. 2. Update to version 2.5.301+ (2.x line) or 3.1.7+ (3.x line) via NuGet Package Manager or package update tooling. 3. Rebuild and test affected applications to confirm compatibility—these are patch releases with no breaking changes. 4. Deploy updates to all production, staging, and development environments that process MessagePack data. 5. Verify the installed version post-deployment using dotnet list package or NuGet auditing tools. 6. Consider implementing input size and nesting-depth validation at the network boundary as an additional defense layer while patching is in progress.
Detection guidance
Monitor application logs and performance metrics for unexpected StackOverflowException errors correlated with MessagePack deserialization, especially from untrusted network sources. Application performance monitoring (APM) tools can flag sudden increases in exception rates or process crashes. Network-based detection is challenging since MessagePack is binary, but anomalously large payloads with repetitive nested structures may warrant scrutiny. Post-patch, a StackOverflowException during deserialization should be treated as a potential attack indicator and logged for forensic review.
Why prioritize this
This vulnerability warrants immediate attention due to its high CVSS score (7.5), unauthenticated remote exploitability, and simplicity of attack. The fix is low-risk and requires minimal testing. Any service accepting MessagePack from external sources should be patched within days, not weeks. Organizations with defense-in-depth input validation may reduce urgency slightly, but patching remains critical given the trivial nature of crafting a malicious payload.
Risk score, explained
The CVSS 7.5 HIGH rating reflects the combination of network accessibility (AV:N), low attack complexity (AC:L), no authentication required (PR:N), no user interaction (UI:N), and high availability impact (A:H). The confidentiality and integrity are unaffected (C:N, I:N), but the denial-of-service impact is severe. For any organization receiving untrusted MessagePack data, this is a critical patch; for those with strict firewall controls or input validation, it remains high-priority but may be scheduled slightly further out.
Frequently asked questions
Does this vulnerability allow remote code execution?
No. The flaw causes a denial of service (application crash) via stack overflow, not code execution. An attacker cannot read data, modify data, or run arbitrary code—only crash the application.
Do I need to change my application code to deploy the patch?
No. The fix is entirely within the MessagePack library. Simply update the NuGet package and redeploy. No application code changes are required, and the fix is backward-compatible.
What if my application never deserializes untrusted MessagePack data?
If you only deserialize MessagePack from trusted, internal sources (e.g., a private backend service you control), your risk is lower, but patching is still recommended for defense in depth and to protect against supply-chain or internal threats.
Can I work around this vulnerability without patching?
Temporarily, you could implement strict message size limits and nesting-depth validation at the network boundary before data reaches your application. However, this is not a substitute for patching—you should patch as soon as practicable to address the root cause.
This analysis is based on the official CVE record and vendor advisory information current as of the publication date. Security landscapes evolve; verify patch availability and compatibility against the official MessagePack GitHub repository and NuGet package pages before deployment. SEC.co does not provide legal, compliance, or vendor-specific technical support—consult your security team and MessagePack maintainers for environment-specific guidance. This content is for informational purposes and should not be construed as a substitute for professional security assessment. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-48502HIGHMessagePack for C# Stack Overflow in Timestamp Parsing
- CVE-2026-48512HIGHMessagePack-CSharp JSON Recursion Denial-of-Service
- CVE-2026-48513HIGHMessagePack C# Union Deserialization Denial of Service
- CVE-2026-46149HIGHLinux Kernel SCSI Target Memory Disclosure & DoS Vulnerability
- CVE-2026-46373HIGHSQLFluff DoS Vulnerability – Resource Exhaustion via Nested Queries
- CVE-2026-4870HIGHIBM Qiskit SDK Parser Denial-of-Service Vulnerability
- CVE-2026-48712HIGHprotobufjs Stack Exhaustion via Recursive Nesting - Denial of Service
- CVE-2026-49847HIGHFreeSWITCH WebSocket JSON Denial-of-Service (Stack Overflow)