Medium

MessagePack allows untrusted data to lead to DoS attack due to hash collisions and stack overflow

  • Disclosed: 17.10.2024
  • Updated: 11.10.2026 11:23

Impact

When this library is used to deserialize messagepack data from an untrusted source, there is a risk of a denial of service attack by an attacker that sends data contrived to produce hash collisions, leading to large CPU consumption disproportionate to the size of the data being deserialized.

This is similar to a prior advisory, which provided an inadequate fix for the hash collision part of the vulnerability.

Patches

The following steps are required to mitigate this risk.

  1. Upgrade to a version of the library where a fix is available. If upgrading from v1, check out our migration guide.
  2. Review the steps in this previous advisory to ensure you have your application configured for untrusted data.

Workarounds

If upgrading MessagePack to a patched version is not an option for you, you may apply a manual workaround as follows:

  1. Declare a class that derives from MessagePackSecurity.
  2. Override the GetHashCollisionResistantEqualityComparer<T> method to provide a collision-resistant hash function of your own and avoid calling base.GetHashCollisionResistantEqualityComparer<T>().
  3. Configure a MessagePackSerializerOptions with an instance of your derived type by calling WithSecurity on an existing options object.
  4. Use your custom options object for all deserialization operations. This may be by setting the MessagePackSerializer.DefaultOptions static property, if you call methods that rely on this default property, and/or by passing in the options object explicitly to any Deserialize method.

References

For more information

If you have any questions or comments about this advisory:

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
.NET (NuGet) MessagePack < 2.5.187, >= 2.6.95-alpha, < 3.0.214-rc.1 2.5.187, 3.0.214-rc.1

References

CVSS score -
Weakness (CWE)
CWE-328
Platform
.NET (NuGet)
Package
MessagePack
Disclosed
17.10.2024
Updated
11.10.2026 11:23

Sources and licenses

OSV / GitHub Advisory Database - GHSA-4qm4-8hg2-g2xm - CC BY 4.0

Vulnerability history: MessagePack

All published vulnerabilities of this package (.NET (NuGet)), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (14) in the archive
Total entries
14
First → latest
01.2020 06.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 3
  • Medium 11

Disclosures per year

  1. 2020: 1
  2. 2021: 0
  3. 2022: 0
  4. 2023: 0
  5. 2024: 1
  6. 2025: 0
  7. 2026: 12
Severity:
  1. High · 7.5 CVE-2026-48506 < 2.5.301, >= 3.0, < 3.1.7 2.5.301, 3.1.7
  2. High · 8.2 CVE-2026-48109 < 2.5.301, >= 3.0.214-rc.1, < 3.1.7 2.5.301, 3.1.7
  3. MessagePack allows untrusted data to lead to DoS attack due to hash collisions and stack overflow this entry
    Medium CVE-2024-48924 < 2.5.187, >= 2.6.95-alpha, < 3.0.214-rc.1 2.5.187, 3.0.214-rc.1

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.