Every CVE Search/ Get API key

CVE-2020-5234

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

4.8 MediumFix available

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

1.58%Up 0.5 points since Apr 14, 2021
90%50%10%1%

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 MediumCVSS: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 MediumCVSS: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:

  1. hash collisions - leading to large CPU consumption disproportionate to the size of the data being deserialized.
  2. 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
  2. Add code to your application to put MessagePack into the defensive UntrustedData mode.
  3. 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.
  4. 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.

  2. 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.

  3. 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:

    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 MediumCVSS: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 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CVSS 2.0
6.8 MediumAV: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 MediumCVSS: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 MediumCVSS: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:

  1. hash collisions - leading to large CPU consumption disproportionate to the size of the data being deserialized.
  2. 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
  2. Add code to your application to put MessagePack into the defensive UntrustedData mode.
  3. 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.
  4. 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.

  2. 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.

  3. 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:

    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 MediumCVSS: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

Affected packages
PackageAffectedFixed
MessagePack
NuGet
before 1.9.11
1.9.11
MessagePack
NuGet
2.0.0 up to 2.1.90
2.1.90
MessagePack.ImmutableCollection
NuGet
before 1.9.11
1.9.11
MessagePack.ImmutableCollection
NuGet
2.0.0 up to 2.1.90
2.1.90
MessagePack.ReactiveProperty
NuGet
before 1.9.11
1.9.11
MessagePack.ReactiveProperty
NuGet
2.0.0 up to 2.1.90
2.1.90
MessagePack.UnityShims
NuGet
before 1.9.11
1.9.11
MessagePack.UnityShims
NuGet
2.0.0 up to 2.1.90
2.1.90
MessagePack.Unity
NuGet
before 1.9.11
1.9.11
MessagePack.Unity
NuGet
2.0.0 up to 2.1.90
2.1.90
Show 10 moreShow less
Affected packages
PackageAffectedFixed
python-msgpack
Azure Linux:3
through 1.0.5-3 None known
MessagePack
NuGet
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 less
0.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
MessagePack
NuGet
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 less
2.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.ImmutableCollection
NuGet
before 1.9.11, plus listed versions
0.2.0-beta0.3.0-beta0.4.00.4.10.4.2
Show 45 moreShow less
0.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.ImmutableCollection
NuGet
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 less
2.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.ReactiveProperty
NuGet
before 1.9.11, plus listed versions
0.1.0-beta0.2.0-beta0.3.0-beta0.4.00.4.1
Show 45 moreShow less
0.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.ReactiveProperty
NuGet
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 less
2.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.UnityShims
NuGet
before 1.9.11, plus listed versions
0.6.00.6.10.7.00.7.20.8.0
Show 45 moreShow less
0.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.UnityShims
NuGet
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 less
2.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.Unity
NuGet
before 1.9.11, plus listed versions
0.2.0-beta0.3.0-beta0.4.00.4.10.4.2
1.9.11

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE 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

This page doesn't list everything

Left out here: 53 versions and the rest of 2 source descriptions. The JSON record has them.

MoveEnter Open