{"answers":{"affected":"6 open source packages ship an affected version, including msgpack5. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-21368 in the wild and no public exploit code.","fix":"Upgrade msgpack5 to a fixed version for your release line: 3.6.1, 4.5.1 or 5.2.1.","what":"CVE-2021-21368 is a medium-severity unsafe deserialization vulnerability in mcollina msgpack5, published on 12 Mar 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-21368 and fix it if it is affected.\n\nWhat it is: CVE-2021-21368 is a medium-severity unsafe deserialization vulnerability in mcollina msgpack5, published on 12 Mar 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2021-21368 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- msgpack5 (npm): affected all versions; fixed in 3.6.1\n- msgpack5 (npm): affected all versions; fixed in 3.6.1\n- msgpack5 (npm): affected from 4.0.0; fixed in 4.5.1\n- msgpack5 (npm): affected from 4.0.0; fixed in 4.5.1\n- msgpack5 (npm): affected from 5.0.0; fixed in 5.2.1\n- msgpack5 (npm): affected from 5.0.0; fixed in 5.2.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-21368/ (Markdown: https://insights.sbomify.com/CVE-2021-21368/index.md)","id":"CVE-2021-21368","markdown":"https://insights.sbomify.com/CVE-2021-21368/index.md","name":"CVE-2021-21368","record":{"aliases":["GHSA-gmjw-49p4-pcfm"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Node.js msgpack library","requires_auth":"low_privilege","summary":"Attackers can craft MessagePack data to poison object prototypes, causing type confusion, unexpected exceptions, or potential code execution in applications using msgpack5.","user_interaction":"required","vuln_class":"deserialization"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"msgpack5","vendor":"msgpack5_project"}],"cvss":{"score":6.7,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-1321","name":"Improperly Controlled Modification of Object Prototype Attributes"},{"id":"CWE-915","name":"Improperly Controlled Modification of Dynamically-Determined Object Attributes"}],"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Prototype poisoning","id":"CVE-2021-21368","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"deserialization","year":"2021"},"n_packages":6,"n_references":6,"next":{"headline":"Potential DoS in Besu HTTP JSON-RPC API","id":"CVE-2021-21369"},"packages":[{"ecosystem":"npm","fixed":["3.6.1"],"introduced":["0"],"last_affected":[],"package":"msgpack5","purl":null,"source":"GHSA-gmjw-49p4-pcfm"},{"ecosystem":"npm","fixed":["3.6.1"],"introduced":["0"],"last_affected":[],"package":"msgpack5","purl":"pkg:npm/msgpack5","source":"GHSA-gmjw-49p4-pcfm"},{"ecosystem":"npm","fixed":["4.5.1"],"introduced":["4.0.0"],"last_affected":[],"package":"msgpack5","purl":null,"source":"GHSA-gmjw-49p4-pcfm"},{"ecosystem":"npm","fixed":["4.5.1"],"introduced":["4.0.0"],"last_affected":[],"package":"msgpack5","purl":"pkg:npm/msgpack5","source":"GHSA-gmjw-49p4-pcfm"},{"ecosystem":"npm","fixed":["5.2.1"],"introduced":["5.0.0"],"last_affected":[],"package":"msgpack5","purl":null,"source":"GHSA-gmjw-49p4-pcfm"},{"ecosystem":"npm","fixed":["5.2.1"],"introduced":["5.0.0"],"last_affected":[],"package":"msgpack5","purl":"pkg:npm/msgpack5","source":"GHSA-gmjw-49p4-pcfm"}],"prev":{"headline":"Incorrect Authorization in switchboard-plug-bluetooth","id":"CVE-2021-21367"},"products":["msgpack5"],"published":"2021-03-12","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["mcollina"]},"summary":"Attackers can craft MessagePack data to poison object prototypes, causing type confusion, unexpected exceptions, or potential code execution in applications using msgpack5.","url":"https://insights.sbomify.com/CVE-2021-21368/"}