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

説明

Summary

The parameterless MessagePackInputFormatter() constructor uses default serializer options, which resolve to MessagePackSerializerOptions.Standard with MessagePackSecurity.TrustedData. The formatter is designed for ASP.NET Core MVC request bodies, which commonly cross an HTTP trust boundary.

This insecure default can expose applications to denial-of-service attacks that MessagePackSecurity.UntrustedData is intended to mitigate, such as hash-collision attacks against dictionary-like model properties.

Impact

Applications are affected when they register new MessagePackInputFormatter() without explicitly passing serializer options configured for untrusted data.

An unauthenticated or otherwise untrusted HTTP client can send MessagePack request bodies that are deserialized using the trusted-data posture. For models containing hash-based collections, this can enable algorithmic complexity attacks using colliding keys. The default constructor makes the unsafe posture easy to use at the exact boundary where request bodies should be treated as untrusted.

Affected components

  • Package: MessagePack.AspNetCoreMvcFormatter
  • API: MessagePackInputFormatter() parameterless constructor
  • Scenario: ASP.NET Core MVC model binding from HTTP request bodies
  • Finding IDs: MESSAGEPACKCSHARP-OPEN-009, duplicate MESSAGEPACKCSHARP-095

Patches

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

Upgrade guidance:

  1. Upgrade MessagePack.AspNetCoreMvcFormatter 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 default the parameterless constructor to MessagePackSerializerOptions.Standard.WithSecurity(MessagePackSecurity.UntrustedData), or require callers to pass explicit options so the trust posture is deliberate.

Workarounds

Do not use the parameterless constructor on affected versions. Register the formatter with explicit untrusted-data options, for example:

options.InputFormatters.Add(
    new MessagePackInputFormatter(
        MessagePackSerializerOptions.Standard.WithSecurity(MessagePackSecurity.UntrustedData)));

Also apply normal HTTP request-size limits and model validation appropriate for your service.

Resources

  • MESSAGEPACKCSHARP-OPEN-009: MVC input formatter defaults to trusted-data security posture
  • MESSAGEPACKCSHARP-095: duplicate finding for the same root cause
  • CWE-1188: Initialization of a Resource with an Insecure Default

基本情報

タイプ
reviewed
深刻度
medium
GitHub 上のアドバイザリ
アドバイザリを開く ↗
リポジトリのアドバイザリ
リポジトリのアドバイザリを開く ↗
ソースコード
ソースを見る ↗
公開(アドバイザリ)
2026-06-25 18:52:46 UTC
更新
2026-06-25 18:52:50 UTC
GitHub レビュー済み
2026-06-25 18:52:46 UTC
NVD で公開
2026-06-22

EPSS Score

Score Percentile
0.24% 14.52%

CVSS Scores

Base score Version Severity Vector
6.3 4.0
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N クリックして展開
攻撃ベクター (AV:N)
インターネットや社内 WAN など、ルーティングされたネットワーク越しに遠隔から踏み台にしうる。
攻撃の複雑さ (AC:H)
タイミング・負荷・周辺設定に左右され、安定して成功させにくい。
攻撃要件 (AT:P)
特定のミドルウェア状態やデータ配置など、追加前提が揃わないと成立しない。
必要な権限 (PR:N)
昇格やログインなしで踏み台にしうる。
ユーザーの関与 (UI:N)
被害者の操作なしでも攻撃が完結しうる。
脆弱システムの機密性への影響 (VC:N)
脆弱な対象から機微情報が読まれうる余地はほとんどない。
脆弱システムの完全性への影響 (VI:L)
レコードや設定の一部が歪められうるが、システム全体の信頼は保たれやすい。
脆弱システムの可用性への影響 (VA:L)
遅延や断続的障害、一部機能の停止など、運用で吸収しうる範囲。
後続システムの機密性への影響 (SC:N)
脆弱点を経由して下流の機微情報が読まれうる余地はほとんどない。
後続システムの完全性への影響 (SI:N)
下流の記録や設定が歪められる局面はほとんど想定されない。
後続システムの可用性への影響 (SA:N)
下流サービスが止まるほどの影響は想定しにくい。

Identifiers

CWEs

CWE id Name
CWE-1188 Initialization of a Resource with an Insecure Default

Credits

  • AArnott (remediation_developer)

Affected packages (2)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
nuget MessagePack < 2.5.301 2.5.301
nuget MessagePack >= 3.0, < 3.1.7 3.1.7

References

cvelogic Threat Intelligence