CVE-2026-48517: MessagePack-CSharp Typeless Deserialization Type Restrictions Do Vulnerability

MODERATE
Advisory Identifier: GHSA-qhmf-xw27-6rqr
CWE-470 CWE-502
Published
Advisory Summary

CVE-2026-48517 is a MODERATE typeless deserialization type restrictions do vulnerability (CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')) affecting MessagePack-CSharp libraries in the NuGet ecosystem. The issue involves typeless deserialization type restrictions do not recurse into arrays or generic arguments. Remediation is available by upgrading affected packages to version 2.5.301, 3.1.7.

CVE-2026-48517 at a Glance

CVE Identifier CVE-2026-48517
GHSA Identifier GHSA-qhmf-xw27-6rqr
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
Affected Product MessagePack-CSharp
Package Ecosystem NuGet
Published Date
Last Updated

How to Fix CVE-2026-48517

To remediate this vulnerability, upgrade all affected MessagePack-CSharp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

MessagePack fixed: 2.5.301
Upgrade MessagePack to 2.5.301
MessagePack fixed: 3.1.7
Upgrade MessagePack to 3.1.7
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for MessagePack

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-48517, inspect your project dependencies for MessagePack-CSharp:

inspect dependencies for MessagePack

Analyze the terminal output to locate any version of MessagePack-CSharp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.5.301), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection'), where the product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code. In MessagePack-CSharp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary MessagePack-CSharp's typeless deserialization includes `MessagePackSerializerOptions.ThrowIfDeserializingTypeIsDisallowed(Type)` as a safety check for dangerous types. The default implementation checks the outer type name, but it does not recursively inspect array element types or generic type arguments. As a result, a type that would be blocked directly can be wrapped inside an array or constructed generic type and pass the outer type check. The formatter machinery can then materialize formatters for the inner blocked type. ## Impact Applications are affected when they deserialize untrusted payloads using typeless serialization features such as `MessagePackSerializer.Typeless`, `TypelessObjectResolver`, or related typeless resolver options. Typeless deserialization is already a high-risk feature for untrusted data, but the presence of a disallowed-type hook creates an expectation that blocked types remain blocked. This issue weakens that mitigation because the check is not applied structurally to nested type components. An attacker who can supply typeless ext-100 payloads may bypass exact outer-type blocklist checks by naming wrapper types such as arrays or generic containers. The consequence depends on which type is reached and what the application allows typeless deserialization to instantiate. The original findings describe bypasses involving blocked or user-blocklisted gadget types. ## Affected components - Package: `MessagePack` - Feature: typeless deserialization - APIs: `MessagePackSerializerOptions.ThrowIfDeserializingTypeIsDisallowed`, `TypelessFormatter` - Finding IDs: `MESSAGEPACKCSHARP-030`, duplicate/open variant `MESSAGEPACKCSHARP-OPEN-007` ## Patches Fixes are available via versions 2.5.301 and 3.1.7. 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 apply type-disallow checks recursively to array element types, pointer/byref element types where applicable, nullable underlying types, and constructed generic type arguments. Formatter paths that materialize types supplied by the wire should not instantiate inner types that fail the configured policy. ## Workarounds Patching is recommended. Avoid typeless deserialization for untrusted data. If typeless support is unavoidable, configure an explicit allowlist that rejects any type not approved by the application and ensure the allowlist recursively validates array elements and generic arguments. Do not rely on exact outer-type blocklists as a complete security boundary. ## Resources - `MESSAGEPACKCSHARP-030`: typeless disallowed-type check is not recursive - `MESSAGEPACKCSHARP-OPEN-007`: duplicate/open finding for typeless blocklist gaps - CWE-502: Deserialization of Untrusted Data - CWE-470: Use of Externally-Controlled Input to Select Classes or Code ## CVE split rationale This vulnerability is independently fixable in typeless type-policy enforcement. It is separate from MVC default options, collection allocation, LZ4 decoding, and recursion-depth issues.

CVE-2026-48517 Affected MessagePack-CSharp Versions

2 component(s)
Fixed Versions:
2.5.3013.1.7
Product / Package Ecosystem Affected Versions Fixed Version
MessagePack
NuGet
< 2.5.301
2.5.301
MessagePack
NuGet
≥ 3.0
< 3.1.7
3.1.7

References

Frequently Asked Questions

What is CVE-2026-48517?
CVE-2026-48517 is a security vulnerability in MessagePack-CSharp involving Typeless deserialization type restrictions do not recurse into arrays or generic arguments under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection').
Which MessagePack-CSharp versions are affected?
Affected versions include releases prior to 2.5.301, 3.1.7 across affected packages: MessagePack.
What version fixes CVE-2026-48517?
Upgrading to 2.5.301, 3.1.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is MessagePack affected?
Yes, MessagePack is affected in releases prior to 2.5.301, 3.1.7. Upgrade your dependency to 2.5.301, 3.1.7 or later.
What CWE is associated with CVE-2026-48517?
CVE-2026-48517 is classified under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') (The product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.).
How can I check NuGet dependencies for CVE-2026-48517?
Run the dependency tree command: 'inspect dependencies for MessagePack'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qhmf-xw27-6rqr",
  "modified" : "2026-06-25T21:31:13Z",
  "published" : "2026-06-25T21:31:13Z",
  "aliases" : [ "CVE-2026-48517" ],
  "summary" : "MessagePack-CSharp: Typeless deserialization type restrictions do not recurse into arrays or generic arguments",
  "details" : "## Summary\n\nMessagePack-CSharp's typeless deserialization includes `MessagePackSerializerOptions.ThrowIfDeserializingTypeIsDisallowed(Type)` as a safety check for dangerous types. The default implementation checks the outer type name, but it does not recursively inspect array element types or generic type arguments.\n\nAs a result, a type that would be blocked directly can be wrapped inside an array or constructed generic type and pass the outer type check. The formatter machinery can then materialize formatters for the inner blocked type.\n\n## Impact\n\nApplications are affected when they deserialize untrusted payloads using typeless serialization features such as `MessagePackSerializer.Typeless`, `TypelessObjectResolver`, or related typeless resolver options.\n\nTypeless deserialization is already a high-risk feature for untrusted data, but the presence of a disallowed-type hook creates an expectation that blocked types remain blocked. This issue weakens that mitigation because the check is not applied structurally to nested type components. An attacker who can supply typeless ext-100 payloads may bypass exact outer-type blocklist checks by naming wrapper types such as arrays or generic containers.\n\nThe consequence depends on which type is reached and what the application allows typeless deserialization to instantiate. The original findings describe bypasses involving blocked or user-blocklisted gadget types.\n\n## Affected components\n\n- Package: `MessagePack`\n- Feature: typeless deserialization\n- APIs: `MessagePackSerializerOptions.ThrowIfDeserializingTypeIsDisallowed`, `TypelessFormatter`\n- Finding IDs: `MESSAGEPACKCSHARP-030`, duplicate/open variant `MESSAGEPACKCSHARP-OPEN-007`\n\n## Patches\n\nFixes are available via versions 2.5.301 and 3.1.7.\n\nUpgrade guidance:\n\n1. Upgrade `MessagePack` to the patched version for your release line.\n2. Upgrade companion MessagePack packages in the same dependency graph to the coordinated patched versions.\n\nThe fix should apply type-disallow checks recursively to array element types, pointer/byref element types where applicable, nullable underlying types, and constructed generic type arguments. Formatter paths that materialize types supplied by the wire should not instantiate inner types that fail the configured policy.\n\n## Workarounds\n\nPatching is recommended.\n\nAvoid typeless deserialization for untrusted data. If typeless support is unavoidable, configure an explicit allowlist that rejects any type not approved by the application and ensure the allowlist recursively validates array elements and generic arguments. Do not rely on exact outer-type blocklists as a complete security boundary.\n\n## Resources\n\n- `MESSAGEPACKCSHARP-030`: typeless disallowed-type check is not recursive\n- `MESSAGEPACKCSHARP-OPEN-007`: duplicate/open finding for typeless blocklist gaps\n- CWE-502: Deserialization of Untrusted Data\n- CWE-470: Use of Externally-Controlled Input to Select Classes or Code\n\n## CVE split rationale\n\nThis vulnerability is independently fixable in typeless type-policy enforcement. It is separate from MVC default options, collection allocation, LZ4 decoding, and recursion-depth issues.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "MessagePack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.5.301"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "MessagePack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0"
      }, {
        "fixed" : "3.1.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MessagePack-CSharp/MessagePack-CSharp/security/advisories/GHSA-qhmf-xw27-6rqr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-48517"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MessagePack-CSharp/MessagePack-CSharp"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-470", "CWE-502" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-25T21:31:13Z",
    "nvd_published_at" : "2026-06-22T22:16:48Z"
  }
}