CVE-2020-5234
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- Low
- User interaction
- Required
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
4.8
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.
- Record
CVE-2020-5234- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H - Weakness
- CWE-121
- Updated
- 2026-11-02
EUVDEUVD-2020-0254
4.8
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.
- Record
EUVD-2020-0254- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-7q36-4xx7-xcxf
4.8
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:
- hash collisions - leading to large CPU consumption disproportionate to the size of the data being deserialized.
- stack overflow - leading to the deserializing process crashing.
Patches
The following steps are required to mitigate this risk.
- Upgrade to a version of the library where a fix is available
- Add code to your application to put MessagePack into the defensive
UntrustedDatamode. - 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. - 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
-
Upgrade to any 1.9.x version.
-
When deserializing untrusted data, put MessagePack into a more secure mode with:
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.
-
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 patchedGenerated.csfile will typically reference theMessagePackSecurityclass.Review any custom-written
IMessagePackFormatter<T>implementations in your project or that you might use from 3rd party packages to ensure they also utilize theMessagePackSecurityclass as required. In particular, a formatter that deserializes an object (as opposed to a primitive value) should wrap the deserialization in ausing (MessagePackSecurity.DepthStep())block. For example:public MyObject Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) { if (reader.TryReadNil()) { return default; } else { using (MessagePackSecurity.DepthStep()) // STACK OVERFLOW MITIGATION { MyObject o = new MyObject(); …
- Record
GHSA-7q36-4xx7-xcxf- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H - Weakness
- CWE-121
- Updated
- 2026-11-02
NVD
4.8
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.
- Record
CVE-2020-5234- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 6.8 Medium
AV:N/AC:L/Au:S/C:N/I:N/A:C - Weakness
- CWE-121, CWE-787
- Updated
- 2026-11-02
OSVAZL-109523
6.5
CVE-2020-5234 affecting package python-msgpack 1.0.5-3
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.
- Record
AZL-109523- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSV
6.5
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.
- Record
CVE-2020-5234- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVGHSA-7q36-4xx7-xcxf
4.8
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:
- hash collisions - leading to large CPU consumption disproportionate to the size of the data being deserialized.
- stack overflow - leading to the deserializing process crashing.
Patches
The following steps are required to mitigate this risk.
- Upgrade to a version of the library where a fix is available
- Add code to your application to put MessagePack into the defensive
UntrustedDatamode. - 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. - 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
-
Upgrade to any 1.9.x version.
-
When deserializing untrusted data, put MessagePack into a more secure mode with:
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.
-
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 patchedGenerated.csfile will typically reference theMessagePackSecurityclass.Review any custom-written
IMessagePackFormatter<T>implementations in your project or that you might use from 3rd party packages to ensure they also utilize theMessagePackSecurityclass as required. In particular, a formatter that deserializes an object (as opposed to a primitive value) should wrap the deserialization in ausing (MessagePackSecurity.DepthStep())block. For example:public MyObject Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) { if (reader.TryReadNil()) { return default; } else { using (MessagePackSecurity.DepthStep()) // STACK OVERFLOW MITIGATION { MyObject o = new MyObject(); …
- Record
GHSA-7q36-4xx7-xcxf- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H - Weakness
- CWE-121
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
MessagePackNuGet |
before 1.9.11 | 1.9.11 |
MessagePackNuGet |
2.0.0 up to 2.1.90 | 2.1.90 |
MessagePack.ImmutableCollectionNuGet |
before 1.9.11 | 1.9.11 |
MessagePack.ImmutableCollectionNuGet |
2.0.0 up to 2.1.90 | 2.1.90 |
MessagePack.ReactivePropertyNuGet |
before 1.9.11 | 1.9.11 |
MessagePack.ReactivePropertyNuGet |
2.0.0 up to 2.1.90 | 2.1.90 |
MessagePack.UnityShimsNuGet |
before 1.9.11 | 1.9.11 |
MessagePack.UnityShimsNuGet |
2.0.0 up to 2.1.90 | 2.1.90 |
MessagePack.UnityNuGet |
before 1.9.11 | 1.9.11 |
MessagePack.UnityNuGet |
2.0.0 up to 2.1.90 | 2.1.90 |
Show 10 moreShow less
| Package | Affected | Fixed |
|---|---|---|
python-msgpackAzure Linux:3 |
through 1.0.5-3 | None known |
MessagePackNuGet |
before 1.9.11, plus listed versions 0.1.0-beta0.2.0-beta0.2.1-beta0.2.2-beta0.2.3-beta Show 45 moreShow less0.3.0-beta0.4.00.4.10.4.20.5.00.6.00.6.10.7.00.7.20.8.00.8.10.8.20.8.30.8.40.8.51.0.01.0.11.0.21.0.31.1.01.1.11.1.1.11.1.21.2.01.2.0.11.2.0.21.2.11.2.21.2.31.3.01.3.11.3.1.11.3.21.3.31.4.01.4.11.4.21.4.31.4.41.5.01.5.0.11.5.0.21.5.11.6.01.6.0.1 |
1.9.11 |
MessagePackNuGet |
2.0.0 up to 2.1.90, plus listed versions 2.0.107-alpha2.0.108-alpha2.0.110-alpha2.0.110-alpha-g1e44a9106f2.0.119-beta Show 10 moreShow less2.0.123-beta2.0.171-beta2.0.204-beta2.0.221-beta2.0.231-rc2.0.270-rc2.0.299-rc2.0.3232.0.3352.1.80 |
2.1.90 |
MessagePack.ImmutableCollectionNuGet |
before 1.9.11, plus listed versions 0.2.0-beta0.3.0-beta0.4.00.4.10.4.2 Show 45 moreShow less0.5.00.6.00.6.10.7.00.7.20.8.00.8.10.8.20.8.30.8.40.8.51.0.01.0.11.0.21.0.31.1.01.1.11.1.21.2.01.2.21.2.31.3.01.3.11.3.1.11.3.21.3.31.4.01.4.11.4.21.4.31.4.41.5.01.5.0.11.5.0.21.5.11.6.01.6.0.11.6.0.21.6.0.31.6.11.6.1.11.6.1.21.6.21.7.01.7.1 |
1.9.11 |
MessagePack.ImmutableCollectionNuGet |
2.0.0 up to 2.1.90, plus listed versions 2.0.107-alpha2.0.108-alpha2.0.110-alpha2.0.110-alpha-g1e44a9106f2.0.119-beta Show 10 moreShow less2.0.123-beta2.0.171-beta2.0.204-beta2.0.221-beta2.0.231-rc2.0.270-rc2.0.299-rc2.0.3232.0.3352.1.80 |
2.1.90 |
MessagePack.ReactivePropertyNuGet |
before 1.9.11, plus listed versions 0.1.0-beta0.2.0-beta0.3.0-beta0.4.00.4.1 Show 45 moreShow less0.4.20.5.00.6.00.6.10.7.00.7.20.8.00.8.10.8.20.8.30.8.40.8.51.0.01.0.11.0.21.0.31.1.01.1.11.1.21.2.01.2.11.2.21.2.31.3.01.3.11.3.1.11.3.21.3.31.4.01.4.11.4.21.4.31.4.41.5.01.5.0.11.5.0.21.5.11.6.01.6.0.11.6.0.21.6.0.31.6.11.6.1.11.6.1.21.6.2 |
1.9.11 |
MessagePack.ReactivePropertyNuGet |
2.0.0 up to 2.1.90, plus listed versions 2.0.107-alpha2.0.108-alpha2.0.110-alpha2.0.110-alpha-g1e44a9106f2.0.119-beta Show 10 moreShow less2.0.123-beta2.0.171-beta2.0.204-beta2.0.221-beta2.0.231-rc2.0.270-rc2.0.299-rc2.0.3232.0.3352.1.80 |
2.1.90 |
MessagePack.UnityShimsNuGet |
before 1.9.11, plus listed versions 0.6.00.6.10.7.00.7.20.8.0 Show 45 moreShow less0.8.10.8.20.8.30.8.40.8.51.0.01.0.11.0.21.0.31.1.01.1.11.1.21.2.01.2.11.2.21.2.31.3.01.3.11.3.1.11.3.21.3.31.4.01.4.11.4.21.4.31.4.41.5.01.5.0.11.5.0.21.5.11.6.01.6.0.11.6.0.21.6.0.31.6.11.6.1.11.6.1.21.6.21.7.01.7.11.7.21.7.31.7.3.11.7.3.21.7.3.3 |
1.9.11 |
MessagePack.UnityShimsNuGet |
2.0.0 up to 2.1.90, plus listed versions 2.0.107-alpha2.0.108-alpha2.0.110-alpha2.0.110-alpha-g1e44a9106f2.0.119-beta Show 10 moreShow less2.0.123-beta2.0.171-beta2.0.204-beta2.0.221-beta2.0.231-rc2.0.270-rc2.0.299-rc2.0.3232.0.3352.1.80 |
2.1.90 |
MessagePack.UnityNuGet |
before 1.9.11, plus listed versions 0.2.0-beta0.3.0-beta0.4.00.4.10.4.2 |
1.9.11 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2020-5234 is a medium vulnerability (CVSS 4.8) in Messagepack, published January 31, 2020. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.58%, the 75th percentile. Fixed in MessagePack 1.9.11.
References
github.com/neuecc/MessagePack-CSharp/security/advisories/GHSA-7q36-4xx7-xcxf
github.com/neuecc/MessagePack-CSharp/commit/56fa86219d01d0a183babbbbcb34abbdea588a02
github.com/neuecc/MessagePack-CSharp/issues/810
github.com/neuecc/MessagePack-CSharp/commit/f88684078698386df02204f13faeff098a61f007
nvd.nist.gov/vuln/detail/CVE-2020-5234
github.com/aspnet/Announcements/issues/405
github.com/MessagePack-CSharp/MessagePack-CSharp/security/advisories/GHSA-7q36-4xx7-xcxf
github.com/advisories/GHSA-7q36-4xx7-xcxf
github.com/MessagePack-CSharp/MessagePack-CSharp
Left out here: 53 versions and the rest of 2 source descriptions. The JSON record has them.