8.8
HIGH
CVE-2021-21368
Microsoft msgpack5 Prototype Poisoning
Description

msgpack5 is a msgpack v5 implementation for node.js and the browser. In msgpack5 before versions 3.6.1, 4.5.1, and 5.2.1 there is a "Prototype Poisoning" vulnerability. When msgpack5 decodes a map containing a key "__proto__", it assigns the decoded value to __proto__. Object.prototype.__proto__ is an accessor property for the receiver's prototype. If the value corresponding to the key __proto__ decodes to an object or null, msgpack5 sets the decoded object's prototype to that value. An attacker who can submit crafted MessagePack data to a service can use this to produce values that appear to be of other types; may have unexpected prototype properties and methods (for example length, numeric properties, and push et al if __proto__'s value decodes to an Array); and/or may throw unexpected exceptions when used (for example if the __proto__ value decodes to a Map or Date). Other unexpected behavior might be produced for other types. There is no effect on the global prototype. This "prototype poisoning" is sort of a very limited inversion of a prototype pollution attack. Only the decoded value's prototype is affected, and it can only be set to msgpack5 values (though if the victim makes use of custom codecs, anything could be a msgpack5 value). We have not found a way to escalate this to true prototype pollution (absent other bugs in the consumer's code). This has been fixed in msgpack5 version 3.6.1, 4.5.1, and 5.2.1. See the referenced GitHub Security Advisory for an example and more details.

INFO

Published Date :

March 12, 2021, 5:15 p.m.

Last Modified :

Nov. 21, 2024, 5:48 a.m.

Remotely Exploitable :

Yes !

Impact Score :

5.9

Exploitability Score :

2.8
Affected Products

The following products are affected by CVE-2021-21368 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Msgpack5_project msgpack5
References to Advisories, Solutions, and Tools

Here, you will find a curated list of external links that provide in-depth information, practical solutions, and valuable tools related to CVE-2021-21368.

URL Resource
https://github.com/mcollina/msgpack5/commit/d4e6cb956ae51c8bb2828e71c7c1107c340cf1e8 Patch Third Party Advisory
https://github.com/mcollina/msgpack5/releases/tag/v3.6.1 Release Notes Third Party Advisory
https://github.com/mcollina/msgpack5/releases/tag/v4.5.1 Release Notes Third Party Advisory
https://github.com/mcollina/msgpack5/releases/tag/v5.2.1 Release Notes Third Party Advisory
https://github.com/mcollina/msgpack5/security/advisories/GHSA-gmjw-49p4-pcfm Exploit Third Party Advisory
https://www.npmjs.com/package/msgpack5 Product Third Party Advisory
https://github.com/mcollina/msgpack5/commit/d4e6cb956ae51c8bb2828e71c7c1107c340cf1e8 Patch Third Party Advisory
https://github.com/mcollina/msgpack5/releases/tag/v3.6.1 Release Notes Third Party Advisory
https://github.com/mcollina/msgpack5/releases/tag/v4.5.1 Release Notes Third Party Advisory
https://github.com/mcollina/msgpack5/releases/tag/v5.2.1 Release Notes Third Party Advisory
https://github.com/mcollina/msgpack5/security/advisories/GHSA-gmjw-49p4-pcfm Exploit Third Party Advisory
https://www.npmjs.com/package/msgpack5 Product Third Party Advisory

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2021-21368 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2021-21368 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Modified by af854a3a-2127-422b-91ae-364da2661108

    Nov. 21, 2024

    Action Type Old Value New Value
    Added Reference https://github.com/mcollina/msgpack5/commit/d4e6cb956ae51c8bb2828e71c7c1107c340cf1e8
    Added Reference https://github.com/mcollina/msgpack5/releases/tag/v3.6.1
    Added Reference https://github.com/mcollina/msgpack5/releases/tag/v4.5.1
    Added Reference https://github.com/mcollina/msgpack5/releases/tag/v5.2.1
    Added Reference https://github.com/mcollina/msgpack5/security/advisories/GHSA-gmjw-49p4-pcfm
    Added Reference https://www.npmjs.com/package/msgpack5
  • CVE Modified by [email protected]

    May. 14, 2024

    Action Type Old Value New Value
  • Reanalysis by [email protected]

    Oct. 24, 2022

    Action Type Old Value New Value
    Added CWE NIST CWE-1321
  • Initial Analysis by [email protected]

    Mar. 19, 2021

    Action Type Old Value New Value
    Added CVSS V2 NIST (AV:N/AC:L/Au:S/C:P/I:P/A:P)
    Added CVSS V3.1 NIST AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
    Changed Reference Type https://github.com/mcollina/msgpack5/commit/d4e6cb956ae51c8bb2828e71c7c1107c340cf1e8 No Types Assigned https://github.com/mcollina/msgpack5/commit/d4e6cb956ae51c8bb2828e71c7c1107c340cf1e8 Patch, Third Party Advisory
    Changed Reference Type https://github.com/mcollina/msgpack5/releases/tag/v3.6.1 No Types Assigned https://github.com/mcollina/msgpack5/releases/tag/v3.6.1 Release Notes, Third Party Advisory
    Changed Reference Type https://github.com/mcollina/msgpack5/releases/tag/v4.5.1 No Types Assigned https://github.com/mcollina/msgpack5/releases/tag/v4.5.1 Release Notes, Third Party Advisory
    Changed Reference Type https://github.com/mcollina/msgpack5/releases/tag/v5.2.1 No Types Assigned https://github.com/mcollina/msgpack5/releases/tag/v5.2.1 Release Notes, Third Party Advisory
    Changed Reference Type https://github.com/mcollina/msgpack5/security/advisories/GHSA-gmjw-49p4-pcfm No Types Assigned https://github.com/mcollina/msgpack5/security/advisories/GHSA-gmjw-49p4-pcfm Exploit, Third Party Advisory
    Changed Reference Type https://www.npmjs.com/package/msgpack5 No Types Assigned https://www.npmjs.com/package/msgpack5 Product, Third Party Advisory
    Added CPE Configuration OR *cpe:2.3:a:msgpack5_project:msgpack5:*:*:*:*:*:node.js:*:* versions up to (excluding) 3.6.1 *cpe:2.3:a:msgpack5_project:msgpack5:*:*:*:*:*:node.js:*:* versions from (including) 4.0.0 up to (excluding) 4.5.1 *cpe:2.3:a:msgpack5_project:msgpack5:*:*:*:*:*:node.js:*:* versions from (including) 5.0.0 up to (excluding) 5.2.1
  • CVE Modified by [email protected]

    Mar. 12, 2021

    Action Type Old Value New Value
    Changed Description msgpack5 is a msgpack v5 implementation for node.js and the browser. In msgpack5 before versions 3.6.1, 4.5.1, and 5.2.1 there is a "Prototype Poisoning" vulnerability. When msgpack5 decodes a map containing a key "__proto__", it assigns the decoded value to __proto__. Object.prototype.__proto__ is an accessor property for the receiver's prototype. If the value corresponding to the key __proto__ decodes to an object or null, msgpack5 sets the decoded object's prototype to that value. An attacker who can submit crafted MessagePack data to a service can use this to produce values that appear to be of other types; may have unexpected prototype properties and methods (for example length, numeric properties, and push et al if __proto__'s value decodes to an Array); and/or may throw unexpected exceptions when used (for example if the __proto__ value decodes to a Map or Date). Other unexpected behavior might be produced for other types. There is no effect on the global prototype. This "prototype poisoning" is sort of a very limited inversion of a prototype pollution attack. Only the decoded value's prototype is affected, and it can only be set to msgpack5 values (though if the victim makes use of custom codecs, anything could be a msgpack5 value). We have not found a way to escalate this to true prototype pollution (absent other bugs in the consumer's code). This has been fixed in msgpack5 version 3.6.1, 4.5.1, and 5.2.1. See the referenced GitHub Security Advisory for an example and more details. msgpack5 is a msgpack v5 implementation for node.js and the browser. In msgpack5 before versions 3.6.1, 4.5.1, and 5.2.1 there is a "Prototype Poisoning" vulnerability. When msgpack5 decodes a map containing a key "__proto__", it assigns the decoded value to __proto__. Object.prototype.__proto__ is an accessor property for the receiver's prototype. If the value corresponding to the key __proto__ decodes to an object or null, msgpack5 sets the decoded object's prototype to that value. An attacker who can submit crafted MessagePack data to a service can use this to produce values that appear to be of other types; may have unexpected prototype properties and methods (for example length, numeric properties, and push et al if __proto__'s value decodes to an Array); and/or may throw unexpected exceptions when used (for example if the __proto__ value decodes to a Map or Date). Other unexpected behavior might be produced for other types. There is no effect on the global prototype. This "prototype poisoning" is sort of a very limited inversion of a prototype pollution attack. Only the decoded value's prototype is affected, and it can only be set to msgpack5 values (though if the victim makes use of custom codecs, anything could be a msgpack5 value). We have not found a way to escalate this to true prototype pollution (absent other bugs in the consumer's code). This has been fixed in msgpack5 version 3.6.1, 4.5.1, and 5.2.1. See the referenced GitHub Security Advisory for an example and more details.
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2021-21368 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Exploit Prediction

EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.

1.20 }} -0.84%

score

0.76975

percentile

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability