cve.bz

CVE-2021-21368 msgpack5 project msgpack5: Prototype Pollution

8.8 highExploit referenceEPSS 1.6%Fix available

High (8.8) in msgpack5 project msgpack5. EPSS 1.6% estimated probability of exploitation activity in the next 30 days. Fixed in msgpack5 3.6.1, 4.5.1, 5.2.1.

On this page
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.

Severity

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
1.6% (unchanged from 1.6% a week ago; 1.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 77th percentile. Scored 2026-11-24. A forecast for this CVE across the internet, not for your own systems.
CWEs
CWE-1321 Improperly Controlled Modification of Object Prototype Attributes (Prototype Pollution)
CWE-915 Improperly Controlled Modification of Dynamically-Determined Object Attributes
OWASP Top 10
A08:2025 Software or Data Integrity Failures
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-21368 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-21368?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-21368?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-21368 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
msgpack5_project:msgpack5before 3.6.1
msgpack5_project:msgpack5from 4.0.0 before 4.5.1
msgpack5_project:msgpack5from 5.0.0 before 5.2.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-gmjw-49p4-pcfmnpmmsgpack5<3.6.13.6.1
GHSA-gmjw-49p4-pcfmnpmmsgpack5>=4.0.0 <4.5.14.5.1
GHSA-gmjw-49p4-pcfmnpmmsgpack5>=5.0.0 <5.2.15.2.1

Attack patterns (CAPEC)

  • CAPEC-1 Accessing Functionality Not Properly Constrained by ACLs Likelihood: High · Severity: High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-180 Exploiting Incorrectly Configured Access Control Security Levels Likelihood: High · Severity: Medium

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON