CVE-2026-48512: MessagePack-CSharp JSON Recursion Denial-of-Service
MessagePack for C# contains multiple unguarded recursion paths in its JSON conversion helpers that allow attackers to trigger stack exhaustion. When processing nested JSON structures or even malformed JSON with repeated separators, the library fails to enforce depth limits consistently, leading to an uncatchable StackOverflowException that crashes the process. This is a denial-of-service vulnerability affecting applications that use MessagePack to deserialize or convert JSON from untrusted sources.
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-25
NVD description (verbatim)
MessagePack for C# is a MessagePack serializer for C#. Prior to 2.5.301 and 3.1.7, MessagePack-CSharp's JSON conversion helpers contain multiple recursion paths that do not consistently enforce a depth limit. These paths are in the JSON conversion component rather than normal typed MessagePack deserialization. MessagePackSerializer.ConvertFromJson recursively processes nested JSON arrays and objects in FromJsonCore() without consulting MessagePackSecurity.MaximumObjectGraphDepth. TinyJsonReader.ReadNextToken() recursively consumes comma and colon separator characters, allowing even malformed JSON with long separator runs to consume one stack frame per character. MessagePackSerializer.ConvertToJson applies depth checks to arrays and maps, but the typeless extension branch for ext-100 recursively calls ToJsonCore() without applying MessagePackSecurity.DepthStep(ref reader). Each path can allow attacker-controlled input to exhaust the process stack and trigger an uncatchable StackOverflowException instead of failing with a catchable parse or serialization exception. 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
MessagePack-CSharp versions prior to 2.5.301 and 3.1.7 contain insufficient recursion depth controls across three distinct code paths: (1) ConvertFromJson does not consult MessagePackSecurity.MaximumObjectGraphDepth when recursively processing nested JSON arrays and objects in FromJsonCore(); (2) TinyJsonReader.ReadNextToken() recursively consumes comma and colon separators without limit, allowing even malformed JSON to exhaust the stack; and (3) ConvertToJson's typeless extension handling for ext-100 recurses into ToJsonCore() without applying MessagePackSecurity.DepthStep(). Each path bypasses the library's established depth-limiting mechanisms, enabling attacker-controlled JSON to cause an uncatchable StackOverflowException.
Business impact
Applications relying on MessagePack-CSharp for JSON conversion are exposed to remote denial-of-service attacks. An attacker can craft malicious JSON payloads to crash processes handling untrusted input, disrupting service availability. Organizations using this library in message processing pipelines, API gateways, or any JSON-to-MessagePack conversion flow should prioritize assessment and patching to prevent operational disruption.
Affected systems
MessagePack for C# versions prior to 2.5.301 (v2 branch) and 3.1.7 (v3 branch) are vulnerable. Systems using these libraries to deserialize JSON or convert between JSON and MessagePack formats are at risk. The vulnerability is triggered only when the JSON conversion helpers (ConvertFromJson, ConvertToJson) are called; standard typed MessagePack deserialization is unaffected.
Exploitability
Exploitation requires only network access to send malicious JSON to an application using the vulnerable conversion functions; no authentication, user interaction, or complex conditions are necessary. Attackers can craft deeply nested JSON objects or arrays, or malformed JSON with long separator sequences, to trigger the stack exhaustion. The attack surface is high for any exposed endpoint accepting JSON input processed through MessagePack-CSharp's conversion methods.
Remediation
Upgrade MessagePack-CSharp to version 2.5.301 or later for the v2 branch, or 3.1.7 or later for the v3 branch. Verify your project's dependency version and check release notes to confirm the patch addresses your specific branch. If immediate patching is not feasible, implement input validation to reject deeply nested JSON structures or apply network-level rate limiting and resource quotas to mitigate stack exhaustion attacks.
Patch guidance
Consult the MessagePack-CSharp project repository and release notes to confirm the exact patched versions for your branch (2.5.301 for v2, 3.1.7 for v3). Update through your package manager (e.g., NuGet for .NET projects) and test thoroughly in a non-production environment before deploying. Verify that your application's JSON conversion code paths exercise the fixed recursion checks.
Detection guidance
Monitor for unexpected StackOverflowException errors in application logs, particularly in code paths calling ConvertFromJson or ConvertToJson. Implement runtime guards to catch and log stack exhaustion attempts; consider adding application-level depth limits on JSON parsing. During network traffic analysis, flag unusually deep JSON structures or suspicious separator patterns in otherwise malformed JSON directed at MessagePack endpoints.
Why prioritize this
This vulnerability merits prompt attention due to its HIGH CVSS score (7.5), lack of authentication requirements, and ease of exploitation. Any exposed endpoint processing untrusted JSON through MessagePack-CSharp conversion functions is immediately at risk of denial-of-service. The impact is direct availability loss without requiring complex exploitation chains.
Risk score, explained
The CVSS 3.1 score of 7.5 reflects a network-accessible vulnerability (AV:N) with no privilege or interaction requirements (AC:L, PR:N, UI:N), affecting availability (A:H) but not confidentiality or integrity. The high severity reflects the ease of triggering denial-of-service in any system relying on JSON-to-MessagePack conversion without depth enforcement.
Frequently asked questions
Does this affect all MessagePack-CSharp usage or only JSON conversion?
Only JSON conversion helpers (ConvertFromJson and ConvertToJson) are vulnerable. Standard typed MessagePack deserialization using MessagePackSerializer.Deserialize is not affected because it already enforces depth limits correctly.
Can I work around this vulnerability without upgrading?
Implement input validation to reject JSON structures exceeding a reasonable depth threshold before passing them to the conversion functions. Additionally, run your application in a container or process with memory and stack size limits to constrain the blast radius of a stack exhaustion attack.
Is this vulnerability listed in the CISA KEV catalog?
No, this vulnerability is not currently on the CISA Known Exploited Vulnerabilities list. However, given its ease of exploitation, monitor the KEV catalog for updates and treat it as a high-priority remediation regardless of KEV status.
What type of JSON payloads trigger this vulnerability?
Deeply nested JSON objects and arrays trigger ConvertFromJson recursion limits. Malformed JSON with long runs of commas or colons can trigger TinyJsonReader recursion. Ext-100 encoded data processed through ConvertToJson without depth checks can also trigger the vulnerability.
This analysis is based on the official CVE description and vendor advisories current as of the published date. Verify all patch version numbers and applicability against the MessagePack-CSharp project repository and your specific deployment configuration. No exploit code or weaponized proof-of-concept is provided. Organizations should conduct their own risk assessment and testing before deploying patches to production systems. 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-48506HIGHMessagePack for C# Recursive Bypass 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)