Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-1321 — Vulnerability Class 142

142 vulnerabilities classified as CWE-1321. AI Chinese analysis included.

CWE-1321 represents a critical vulnerability where applications fail to restrict modifications to an object’s prototype attributes, allowing attackers to inject malicious properties into the global prototype chain. This weakness is typically exploited by crafting specific input payloads that target JavaScript objects, enabling the injection of arbitrary keys such as constructor or prototype references. Successful exploitation can lead to severe consequences, including remote code execution, denial of service, or privilege escalation, as the injected properties affect all subsequent instances of the affected object. To mitigate this risk, developers must implement strict input validation, utilize libraries that freeze prototypes, or employ object creation methods that do not inherit from the global prototype, such as Object.create(null). Additionally, avoiding the use of unsafe recursive merge functions and sanitizing user-controlled data before processing are essential practices for preventing prototype pollution attacks in modern web applications.

MITRE CWE Description
The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.
Common Consequences (2)
Confidentiality, Integrity, AvailabilityRead Application Data, Modify Application Data
This weakness is usually exploited by using a special attribute of objects called proto, constructor, or prototype. Such attributes give access to the object prototype. An attacker can inject attributes that are used in other components by adding or modifying attributes of an object prototype. This …
AvailabilityDoS: Crash, Exit, or Restart
An attacker can override existing attributes with ones that have incompatible type, which may lead to a crash.
Mitigations (5)
ImplementationBy freezing the object prototype first (for example, Object.freeze(Object.prototype)), modification of the prototype becomes impossible.
Effectiveness: High
Architecture and DesignBy blocking modifications of attributes that resolve to object prototype, such as proto or prototype, this weakness can be mitigated.
Effectiveness: High
ImplementationWhen handling untrusted objects, validating using a schema can be used.
Effectiveness: Limited
ImplementationBy using an object without prototypes (via Object.create(null) ), adding object prototype attributes by accessing the prototype via the special attributes becomes impossible, mitigating this weakness.
Effectiveness: High
ImplementationMap can be used instead of objects in most cases. If Map methods are used instead of object attributes, it is not possible to access the object prototype or modify it.
Effectiveness: Moderate
Examples (1)
This function sets object attributes based on a dot-separated path.
function setValueByPath (object, path, value) { const pathArray = path.split("."); const attributeToSet = pathArray.pop(); let objectToModify = object; for (const attr of pathArray) { if (typeof objectToModify[attr] !== 'object') { objectToModify[attr] = {}; } objectToModify = objectToModify[attr]; } objectToModify[attributeToSet] = value; return object; }
Bad · JavaScript
setValueByPath({}, "__proto__.isAdmin", true) setValueByPath({}, "constructor.prototype.isAdmin", true)
Bad · JavaScript
CVE IDTitleCVSSSeverityPublished
CVE-2024-2495 Cryptographic key in plain text vulnerability in FriendlyElec's FriendlyWrt — FriendlyWrt 5.2 Medium2024-03-15
CVE-2024-27307 JSONata expression can pollute the "Object" prototype — jsonata 9.8 Critical2024-03-06
CVE-2024-23339 hoolock does not block Prototype pollution with object-path related utilities — hoolock 6.3 Medium2024-01-22
CVE-2023-39296 QTS, QuTS hero — QTS 7.5 High2024-01-05
CVE-2023-26158 Mock.js 安全漏洞 — mockjs 8.2 High2023-12-08
CVE-2023-6293 Prototype Pollution in robinbuschmann/sequelize-typescript — robinbuschmann/sequelize-typescript 9.8 -2023-11-24
CVE-2023-45827 Prototype Pollution vulnerability in @clickbar/dot-diver — dot-diver 7.3 High2023-11-06
CVE-2023-45811 Prototype pollution vulnerability leading to arbitrary code execution in synchrony deobfuscator — synchrony 8.2 High2023-10-17
CVE-2023-26139 underscore-keypath 安全漏洞 — underscore-keypath 7.5 High2023-08-01
CVE-2023-3696 Prototype Pollution in automattic/mongoose — automattic/mongoose 9.8 -2023-07-17
CVE-2023-26136 tough-cookie 安全漏洞 — tough-cookie 6.5 Medium2023-07-01
CVE-2023-26135 flatnest 安全漏洞 — flatnest 7.3 High2023-06-30
CVE-2023-36475 Parse Server vulnerable to remote code execution via MongoDB BSON parser through prototype pollution — parse-server 9.8 Critical2023-06-28
CVE-2023-26133 ProgressBar.js 安全漏洞 — progressbar.js 8.2 High2023-06-12
CVE-2023-26132 dottie 安全漏洞 — dottie 7.5 High2023-06-10
CVE-2023-2972 Prototype Pollution in antfu/utils — antfu/utils 9.8 -2023-05-30
CVE-2023-30857 @aedart/support possibly vulnerable to prototype pollution in metadata record, when using meta decorator — ion 3.7 Low2023-04-28
CVE-2023-26121 safe-eval 安全漏洞 — safe-eval 7.5 High2023-04-11
CVE-2022-36060 Prototype pollution in matrix-react-sdk — matrix-react-sdk 8.2 High2023-03-28
CVE-2023-28103 Prototype pollution in matrix-react-sdk — matrix-react-sdk 8.2 High2023-03-28
CVE-2023-28427 Prototype pollution in matrix-js-sdk — matrix-js-sdk 8.2 High2023-03-28
CVE-2022-36059 Prototype pollution in matrix-js-sdk — matrix-js-sdk 8.2 High2023-03-28
CVE-2023-26113 Collection 安全漏洞 — collection.js 7.5 High2023-03-18
CVE-2023-26106 dot-lens 安全漏洞 — dot-lens 7.5 High2023-03-06
CVE-2023-26105 mde utilities 安全漏洞 — utilities 7.5 High2023-02-28
CVE-2023-26102 rangy 安全漏洞 — rangy 7.5 High2023-02-24
CVE-2022-3901 Visioweb.js - Prototype Pollution can results in XSS — Visioweb 7.2 High2023-02-20
CVE-2021-4307 Yomguithereal Baobab prototype pollution — Baobab 6.3 Medium2023-01-07
CVE-2022-4742 json-pointer index.js set prototype pollution — json-pointer 6.3 Medium2022-12-26
CVE-2021-4279 Starcounter-Jack JSON-Patch prototype pollution — JSON-Patch 6.3 Medium2022-12-25

Vulnerabilities classified as CWE-1321 represent 142 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.