CVE-2023-26158
Description
All versions of mockjs are vulnerable to prototype pollution via the Util.extend function, allowing attackers to modify Object.prototype and potentially cause denial of service or remote code execution.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
All versions of mockjs are vulnerable to prototype pollution via the Util.extend function, allowing attackers to modify Object.prototype and potentially cause denial of service or remote code execution.
The mockjs package, used for generating simulation data, is vulnerable to prototype pollution in all versions. The vulnerability resides in the Util.extend function, which fails to check whether an attribute resolves to the object prototype, such as __proto__, constructor, or prototype. This allows an attacker to manipulate properties on Object.prototype through user-controlled inputs passed to the extend() method in Mock.Handler, Mock.Random, Mock.RE.Handler, or Mock.Util [1].
Exploitation requires the attacker to control inputs to these extend() methods. Since prototype pollution affects all objects inherited from Object.prototype, an attacker can inject or modify properties globally. This can be achieved by supplying a malicious object with a __proto__ property that contains the desired pollution [1].
The impact of this vulnerability includes denial of service by triggering JavaScript exceptions or altering application logic. More critically, it can lead to remote code execution if the attacker is able to force code paths that rely on polluted properties [2]. The exact severity depends on how the affected application uses mockjs and whether user input reaches the vulnerable functions.
As a workaround, the vendor suggests adding a denylist of dangerous attributes within the Util.extend function, specifically skipping properties named __proto__, constructor, and prototype. No official patch has been released as of the publication date, so users must apply this workaround manually or avoid using user-controlled inputs with the affected methods [1].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
mockjsnpm | <= 1.1.0 | — |
Affected products
2- mockjs/mockjsdescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-mh8j-9jvh-gjf6ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-26158ghsaADVISORY
- github.com/nuysoft/Mock/blob/00ce04b92eb464e664a4438430903f2de96efb47/dist/mock.jsghsaWEB
- security.snyk.io/vuln/SNYK-JS-MOCKJS-6051365ghsaWEB
- github.com/nuysoft/Mock/blob/00ce04b92eb464e664a4438430903f2de96efb47/dist/mock.js%23L721-L755mitre
News mentions
0No linked articles in our index yet.