CVE-2021-21368

Source
https://cve.org/CVERecord?id=CVE-2021-21368
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21368.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2021-21368
Aliases
Published
2021-03-12T17:15:12.863Z
Modified
2026-07-09T01:30:44.198482Z
Severity
  • 8.8 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
[none]
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.

References

Affected packages

Git / github.com/mcollina/msgpack5

Affected ranges

Type
GIT
Repo
https://github.com/mcollina/msgpack5
Events
Database specific
{
    "source": [
        "CPE_RANGE",
        "REFERENCES"
    ],
    "cpe": "cpe:2.3:a:msgpack5_project:msgpack5:*:*:*:*:*:node.js:*:*",
    "extracted_events": [
        {
            "introduced": "0"
        },
        {
            "fixed": "3.6.1"
        },
        {
            "introduced": "4.0.0"
        },
        {
            "fixed": "4.5.1"
        },
        {
            "introduced": "5.0.0"
        },
        {
            "fixed": "5.2.1"
        }
    ]
}

Affected versions

v4.*
v4.0.0
v4.0.1
v4.0.2
v4.1.0
v4.2.0
v4.5.0
v5.*
v5.0.0
v5.1.0
v5.2.0
v5.2.1
v5.3.0

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21368.json"