Public mode

No access to your tenant or devices. Every item links to its source. What this means

Sources need attention Customize Public modeDiscuss ChangeIntel on Discord

Untrusted data can lead to DoS attack in MessagePack for C# and Unity

CVSS 3.1 4.8 MEDIUMEUVD CVSS 3.1 4.8 CVSS 3.1 · [email protected] · Secondary 4.8 MEDIUMCVSS 3.1 · [email protected] · Primary 6.5 MEDIUMCVSS 2.0 · [email protected] · Primary 6.8 MEDIUMCVSS_V3 Publisher rating MODERATEFixed by MessagePack 1.9.11Fixed by MessagePack 2.1.90Fixed by MessagePack.ImmutableCollection 1.9.11Fixed by MessagePack.ImmutableCollection 2.1.90KEV status unknown

cve-program · CVE-2020-5234

Published

MessagePack for C# and Unity before version 1.9.11 and 2.1.90 has a vulnerability where untrusted data can lead to DoS attack due to hash collisions and stack overflow. Review the linked GitHub Security Advisory for more information and remediation steps.

Read the publisher's advisory

euvd · EUVD-2020-0254

Published

MessagePack for C# and Unity before version 1.9.11 and 2.1.90 has a vulnerability where untrusted data can lead to DoS attack due to hash collisions and stack overflow. Review the linked GitHub Security Advisory for more information and remediation steps.

Read the publisher's advisory

nvd · CVE-2020-5234

Published

MessagePack for C# and Unity before version 1.9.11 and 2.1.90 has a vulnerability where untrusted data can lead to DoS attack due to hash collisions and stack overflow. Review the linked GitHub Security Advisory for more information and remediation steps.

Read the publisher's advisory

osv · GHSA-7q36-4xx7-xcxf

Published

### 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 either of two vectors: 1. hash collisions - leading to large CPU consumption disproportionate to the size of the data being deserialized. 1. stack overflow - leading to the deserializing process crashing. ### Patches The following steps are required to mitigate this risk. 1. Upgrade to a version of the library where a fix is available 1. Add code to your application to put MessagePack into the defensive `UntrustedData` mode. 1. Identify all MessagePack extensions that implement `IMessagePackFormatter<T>` implementations that do not ship with the MessagePack library to include the security mitigations. This includes those acquired from 3rd party packages and classes included directly into your project. Any AOT formatters generated with the MPC tool must be regenerated with the patched version of mpc. 1. Review your messagepack-serializable data structures for hash-based collections that use custom or unusual types for the hashed key. See below for details on handling such situations. Review the `MessagePackSecurity` class to tweak any settings as necessary to strike the right balance between performance, functionality, and security. Specialized `IEqualityComparer<T>` implementations provide the hash collision resistance. Each type of hashed key may require a specialized implementation of its own. The patched MessagePack library includes many such implementations for primitive types commonly used as keys in hash-based collections. If your data structures use custom types as keys in these hash-based collections, putting MessagePack in `UntrustedData` mode may lead the deserializer to throw an exception because no safe `IEqualityComparer<T>` is available for your custom `T` type. You can provide your own safe implementation by deriving from the `MessagePackSecurity` class and overriding the `GetHashCollisionResistantEqualityComparer<T>()` method to return your own custom implementation when `T` matches your type, and fallback to `return base.GetHashCollisionResistantEqualityComparer<T>();` for types you do not have custom implementations for. Unrelated to this advisory, but as general security guidance, you should also avoid the Typeless serializer/formatters/resolvers for untrusted data as that opens the door for the untrusted data to potentially deserialize unanticipated types that can compromise security. #### MessagePack 1.x users 1. Upgrade to any 1.9.x version. 1. When deserializing untrusted data, put MessagePack into a more secure mode with: ```cs MessagePackSecurity.Active = MessagePackSecurity.UntrustedData; ``` In MessagePack v1.x this is a static property and thus the security level is shared by the entire process or AppDomain. Use MessagePack v2.1 or later for better control over the security level for your particular use. 1. Any code produced by mpc should be regenerated with the mpc tool with the matching (patched) version. Such generated code usually is written to a file called `Generated.cs`. A patched `Generated.cs` file will typically reference the `MessagePackSecurity` class. Review any custom-written `IMessagePackFormatter<T>` implementations in your project or that you might use from 3rd party packages to ensure they also utilize the `MessagePackSecurity` class as required. In particular, a formatter that deserializes an object (as opposed to a primitive value) should wrap the deserialization in a `using (MessagePackSecurity.DepthStep())` block. For example: ```cs public MyObject Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) { if (reader.TryReadNil()) { return default; } else { using (MessagePackSecurity.DepthStep()) // STACK OVERFLOW MITIGATION { MyObject o = new MyObject(); // deserialize members of the object here. return o; } } } ``` If your custom formatter creates hash-based collections (e.g. `Dictionary<K, V>` or `HashSet<T>`) where the hashed key comes from the messagepack data, always instantiate your collection using `MessagePackSecurity.Active.GetEqualityComparer<T>()` as the equality comparer: ```cs var collection = new HashSet<T>(MessagePackSecurity.Active.GetEqualityComparer<T>()); ``` This ensures that when reading untrusted data, you will be using a collision-resistent hash algorithm. Learn more about [best security practices when reading untrusted data with MessagePack 1.x](https://github.com/neuecc/MessagePack-CSharp/tree/v1.x#security). #### MessagePack 2.x users 1. Upgrade to any 2.1.x or later version. 1. When deserializing untrusted data, put MessagePack into a more secure mode by configuring your `MessagePackSerializerOptions.Security` property: ```cs var options = MessagePackSerializerOptions.Standard .WithSecurity(MessagePackSecurity.UntrustedData); // Pass the options explicitly for the greatest control. T object = MessagePackSerializer.Deserialize<T>(data, options); // Or set the security level as the default. MessagePackSerializer.DefaultOptions = options; ``` 1. Any code produced by mpc should be regenerated with the mpc tool with the matching (patched) version. Such generated code usually is written to a file called `Generated.cs`. A patched `Generated.cs` file will typically reference the `Security` member on the `MessagePackSerializerOptions` parameter. Review any custom-written `IMessagePackFormatter<T>` implementations in your project or that you might use from 3rd party packages to ensure they also utilize the `MessagePackSecurity` class as required. In particular, a formatter that deserializes an object (as opposed to a primitive value) should call `options.Security.DepthStep(ref reader);` before deserializing the object's members, and be sure to revert the depth step with `reader.Depth--;` before exiting the method. For example: ```cs public MyObject Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) { if (reader.TryReadNil()) { return default; } else { options.Security.DepthStep(ref reader); // STACK OVERFLOW MITIGATION, line 1 try { MyObject o = new MyObject(); // deserialize members of the object here. return o; } finally { reader.Depth--; // STACK OVERFLOW MITIGATION, line 2 } } } ``` If your custom formatter creates hash-based collections (e.g. `Dictionary<K, V>` or `HashSet<T>`) where the hashed key comes from the messagepack data, always instantiate your collection using `options.Security.GetEqualityComparer<TKey>()` as the equality comparer: ```cs var collection = new HashSet<T>(options.Security.GetEqualityComparer<T>()); ``` This ensures that when reading untrusted data, you will be using a collision-resistent hash algorithm. Learn more about [best security practices when reading untrusted data with MessagePack 2.x](https://github.com/neuecc/MessagePack-CSharp#security). ### Workarounds The security vulnerabilities are in the formatters. Avoiding the built-in formatters entirely in favor of reading messagepack primitive data directly or relying on carefully written custom formatters can provide a workaround. MessagePack v1.x users may utilize the `MessagePackBinary` static class directly to read the data they expect. MessagePack v2.x users may utilize the `MessagePackReader` struct directly to read the data they expect. ### References Learn more about best security practices when reading untrusted data with [MessagePack 1.x](https://github.com/neuecc/MessagePack-CSharp/tree/v1.x#security) or [MessagePack 2.x](https://github.com/neuecc/MessagePack-CSharp#security). ### For more information If you have any questions or comments about this advisory: * Open an issue in [MessagePack-CSharp](https://github.com/neuecc/MessagePack-CSharp/issues/new/choose) * [Email us](mailto:[email protected])

Read the publisher's advisory

Affected versions, risk and source history

Exploitation and risk

Source status

CISA KEV lists vulnerabilities known to be exploited. FIRST EPSS estimates the likelihood of exploitation in the next 30 days. An unavailable score does not mean zero risk.

Which CVEs have scores here?

This view includes predictions for CVE identifiers explicitly listed in public NuGet advisories. Microsoft release pages have their own prediction coverage. Check source status for the scope and latest checks.

CVE-2020-5234

This is a saved version of the risk data. The advisory details have their own history. Latest risk data.

No CISA KEV listing is included in this saved record. Exploitation may still have occurred.

FIRST EPSS: 1.58 % · percentile 75.69 % · scored 10 Nov 2026. This score is more than two days old.

Saved 10 Nov 2026 20:24:10 UTC · View this risk record (JSON)

cve-program · CVE-2020-5234

Published

Untrusted data can lead to DoS attack in MessagePack for C# and Unity

MessagePack for C# and Unity before version 1.9.11 and 2.1.90 has a vulnerability where untrusted data can lead to DoS attack due to hash collisions and stack overflow. Review the linked GitHub Security Advisory for more information and remediation steps.

Source published
31 Jan 2020 17:50:14 UTC
Source modified
4 Aug 2024 08:22:09 UTC
Saved here
23 Oct 2026 15:48:27 UTC
Source terms
CVE Program Terms of Use

Original source record · Cite this exact observation · Complete original publisher JSON

Source: cve-program · CVE Program Terms of Use. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.

CVSS 3.1 · 4.8 CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H

euvd · EUVD-2020-0254

Published

MessagePack for C# and Unity before version 1.9.11 and 2.1.90 has a vulnerability where untrusted data can lead to DoS attack due to hash collisions and stack overflow. Review the linked GitHub Security Advisory for more information and rem…

MessagePack for C# and Unity before version 1.9.11 and 2.1.90 has a vulnerability where untrusted data can lead to DoS attack due to hash collisions and stack overflow. Review the linked GitHub Security Advisory for more information and remediation steps.

Additional publisher context

EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON.

Original publisher date fields

datePublished: Jan 31, 2020, 5:50:14 PM

dateUpdated: Aug 4, 2024, 8:22:09 AM

1 related source bulletins · separate from aliases

msrc_CVE-2020-5234: Untrusted data can lead to DoS attack in MessagePack for C# and Unity

CVE-2020-5234

Source published
Jan 31, 2020, 5:50:14 PM (timezone not stated)
Source modified
Aug 4, 2024, 8:22:09 AM (timezone not stated)
Saved here
17 Nov 2026 23:42:28 UTC
Source terms
ENISA EUVD · source terms and attribution apply

Original source record · Cite this exact observation · Complete original publisher JSON

Source: euvd · ENISA EUVD · source terms and attribution apply. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.

EUVD CVSS 3.1 · 4.8 CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H

nvd · CVE-2020-5234

Published

MessagePack for C# and Unity before version 1.9.11 and 2.1.90 has a vulnerability where untrusted data can lead to DoS attack due to hash collisions and stack overflow. Review the linked GitHub Security Advisory for more information and rem…

MessagePack for C# and Unity before version 1.9.11 and 2.1.90 has a vulnerability where untrusted data can lead to DoS attack due to hash collisions and stack overflow. Review the linked GitHub Security Advisory for more information and remediation steps.

Additional publisher context

NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON.

Source analysis status: Modified

Weakness classifications: CWE-121 · CWE-787

Original publisher date fields

published: 2020-01-31T18:15:11.860

lastModified: 2026-06-17T03:21:04.867

8 source CPE criteria · context only
  • cpe:2.3:a:messagepack:messagepack:*:*:*:*:*:c\#:*:*
  • cpe:2.3:a:messagepack:messagepack:2.0.94:alpha:*:*:*:c\#:*:*
  • cpe:2.3:a:messagepack:messagepack:2.0.110:alpha:*:*:*:c\#:*:*
  • cpe:2.3:a:messagepack:messagepack:2.0.119:beta:*:*:*:c\#:*:*
  • cpe:2.3:a:messagepack:messagepack:2.0.123:beta:*:*:*:c\#:*:*
  • cpe:2.3:a:messagepack:messagepack:2.0.204:beta:*:*:*:c\#:*:*
  • cpe:2.3:a:messagepack:messagepack:2.0.270:rc:*:*:*:c\#:*:*
  • cpe:2.3:a:messagepack:messagepack:2.0.299:rc:*:*:*:c\#:*:*

The original JSON retains the logical configuration operators, exclusions and version bounds.

Source published
31 Jan 2020 18:15:11 UTC
Source modified
17 Jun 2026 03:21:04 UTC
Saved here
24 Oct 2026 17:17:15 UTC
Source terms
NIST NVD usage terms; underlying source attribution retained

Original source record · Cite this exact observation · Complete original publisher JSON

Source: nvd · NIST NVD usage terms; underlying source attribution retained. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.

CVSS 3.1 · [email protected] · Secondary · 4.8 CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H

CVSS 3.1 · [email protected] · Primary · 6.5 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

CVSS 2.0 · [email protected] · Primary · 6.8 AV:N/AC:L/Au:S/C:N/I:N/A:C

osv · GHSA-7q36-4xx7-xcxf

Published

Untrusted data can lead to DoS attack due to hash collisions and stack overflow in MessagePack

### 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 either of two vectors: 1. hash collisions - leading to large CPU consumption disproportionate to the size of the data being deserialized. 1. stack overflow - leading to the deserializing process crashing. ### Patches The following steps are required to mitigate this risk. 1. Upgrade to a version of the library where a fix is available 1. Add code to your application to put MessagePack into the defensive `UntrustedData` mode. 1. Identify all MessagePack extensions that implement `IMessagePackFormatter<T>` implementations that do not ship with the MessagePack library to include the security mitigations. This includes those acquired from 3rd party packages and classes included directly into your project. Any AOT formatters generated with the MPC tool must be regenerated with the patched version of mpc. 1. Review your messagepack-serializable data structures for hash-based collections that use custom or unusual types for the hashed key. See below for details on handling such situations. Review the `MessagePackSecurity` class to tweak any settings as necessary to strike the right balance between performance, functionality, and security. Specialized `IEqualityComparer<T>` implementations provide the hash collision resistance. Each type of hashed key may require a specialized implementation of its own. The patched MessagePack library includes many such implementations for primitive types commonly used as keys in hash-based collections. If your data structures use custom types as keys in these hash-based collections, putting MessagePack in `UntrustedData` mode may lead the deserializer to throw an exception because no safe `IEqualityComparer<T>` is available for your custom `T` type. You can provide your own safe implementation by deriving from the `MessagePackSecurity` class and overriding the `GetHashCollisionResistantEqualityComparer<T>()` method to return your own custom implementation when `T` matches your type, and fallback to `return base.GetHashCollisionResistantEqualityComparer<T>();` for types you do not have custom implementations for. Unrelated to this advisory, but as general security guidance, you should also avoid the Typeless serializer/formatters/resolvers for untrusted data as that opens the door for the untrusted data to potentially deserialize unanticipated types that can compromise security. #### MessagePack 1.x users 1. Upgrade to any 1.9.x version. 1. When deserializing untrusted data, put MessagePack into a more secure mode with: ```cs MessagePackSecurity.Active = MessagePackSecurity.UntrustedData; ``` In MessagePack v1.x this is a static property and thus the security level is shared by the entire process or AppDomain. Use MessagePack v2.1 or later for better control over the security level for your particular use. 1. Any code produced by mpc should be regenerated with the mpc tool with the matching (patched) version. Such generated code usually is written to a file called `Generated.cs`. A patched `Generated.cs` file will typically reference the `MessagePackSecurity` class. Review any custom-written `IMessagePackFormatter<T>` implementations in your project or that you might use from 3rd party packages to ensure they also utilize the `MessagePackSecurity` class as required. In particular, a formatter that deserializes an object (as opposed to a primitive value) should wrap the deserialization in a `using (MessagePackSecurity.DepthStep())` block. For example: ```cs public MyObject Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) { if (reader.TryReadNil()) { return default; } else { using (MessagePackSecurity.DepthStep()) // STACK OVERFLOW MITIGATION { MyObject o = new MyObject(); // deserialize members of the object here. return o; } } } ``` If your custom formatter creates hash-based collections (e.g. `Dictionary<K, V>` or `HashSet<T>`) where the hashed key comes from the messagepack data, always instantiate your collection using `MessagePackSecurity.Active.GetEqualityComparer<T>()` as the equality comparer: ```cs var collection = new HashSet<T>(MessagePackSecurity.Active.GetEqualityComparer<T>()); ``` This ensures that when reading untrusted data, you will be using a collision-resistent hash algorithm. Learn more about [best security practices when reading untrusted data with MessagePack 1.x](https://github.com/neuecc/MessagePack-CSharp/tree/v1.x#security). #### MessagePack 2.x users 1. Upgrade to any 2.1.x or later version. 1. When deserializing untrusted data, put MessagePack into a more secure mode by configuring your `MessagePackSerializerOptions.Security` property: ```cs var options = MessagePackSerializerOptions.Standard .WithSecurity(MessagePackSecurity.UntrustedData); // Pass the options explicitly for the greatest control. T object = MessagePackSerializer.Deserialize<T>(data, options); // Or set the security level as the default. MessagePackSerializer.DefaultOptions = options; ``` 1. Any code produced by mpc should be regenerated with the mpc tool with the matching (patched) version. Such generated code usually is written to a file called `Generated.cs`. A patched `Generated.cs` file will typically reference the `Security` member on the `MessagePackSerializerOptions` parameter. Review any custom-written `IMessagePackFormatter<T>` implementations in your project or that you might use from 3rd party packages to ensure they also utilize the `MessagePackSecurity` class as required. In particular, a formatter that deserializes an object (as opposed to a primitive value) should call `options.Security.DepthStep(ref reader);` before deserializing the object's members, and be sure to revert the depth step with `reader.Depth--;` before exiting the method. For example: ```cs public MyObject Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) { if (reader.TryReadNil()) { return default; } else { options.Security.DepthStep(ref reader); // STACK OVERFLOW MITIGATION, line 1 try { MyObject o = new MyObject(); // deserialize members of the object here. return o; } finally { reader.Depth--; // STACK OVERFLOW MITIGATION, line 2 } } } ``` If your custom formatter creates hash-based collections (e.g. `Dictionary<K, V>` or `HashSet<T>`) where the hashed key comes from the messagepack data, always instantiate your collection using `options.Security.GetEqualityComparer<TKey>()` as the equality comparer: ```cs var collection = new HashSet<T>(options.Security.GetEqualityComparer<T>()); ``` This ensures that when reading untrusted data, you will be using a collision-resistent hash algorithm. Learn more about [best security practices when reading untrusted data with MessagePack 2.x](https://github.com/neuecc/MessagePack-CSharp#security). ### Workarounds The security vulnerabilities are in the formatters. Avoiding the built-in formatters entirely in favor of reading messagepack primitive data directly or relying on carefully written custom formatters can provide a workaround. MessagePack v1.x users may utilize the `MessagePackBinary` static class directly to read the data they expect. MessagePack v2.x users may utilize the `MessagePackReader` struct directly to read the data they expect. ### References Learn more about best security practices when reading untrusted data with [MessagePack 1.x](https://github.com/neuecc/MessagePack-CSharp/tree/v1.x#security) or [MessagePack 2.x](https://github.com/neuecc/MessagePack-CSharp#security). ### For more information If you have any questions or comments about this advisory: * Open an issue in [MessagePack-CSharp](https://github.com/neuecc/MessagePack-CSharp/issues/new/choose) * [Email us](mailto:[email protected])

Source published
31 Jan 2020 17:59:20 UTC
Source modified
10 Sep 2026 03:48:45 UTC
Saved here
23 Oct 2026 16:01:25 UTC
Source terms
GitHub Advisory Database · CC-BY-4.0

Original source record · Cite this exact observation · Complete original publisher JSON

Source: osv · GitHub Advisory Database · CC-BY-4.0. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.

CVSS_V3 · CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H

Publisher rating · MODERATE

ChangeIntel

An IT change radar: releases, security, known issues, retirements, documentation changes, and service status from public sources. Every item links to supporting evidence; dates and statuses can change after they are read.

Sources read 19 Nov 06:56 UTC · 273 of 275 readable · 269 fully read · documentation 469/469 current