Untrusted data can lead to DoS attack due to hash collisions and stack overflow in MessagePack
概要
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
IMessagePackFormatterimplementations 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 implementations provide the hash collision resistance.
Each type of hashed key may require a specialized implementation of its own.
The patched MessagePack library includ…
出典: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
影響パッケージ
参照URL
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com