Home / mockjs / mockjs / CVE-2023-26158
CVE-2023-26158: is it exploited, and which versions of mockjs are affected and fixed?
CVE-2023-26158 is a prototype pollution vulnerability in mockjs. It is not known to be exploited: it is not in CISA's Known Exploited Vulnerabilities catalog (catalog 2026.11.30, read December 3, 2026, 16:39 UTC). Affected: mockjs through 1.1.0 (GitHub advisory GHSA-mh8j-9jvh-gjf6). No fixed version is listed in the sources yet; check the vendor advisory. Severity: High (8.2, CVSS 3.1, from snyk).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 16:39 UTC, CVE record November 19, 2026, 07:13 UTC and NVD November 19, 2026, 07:33 UTC.
What is CVE-2023-26158?
All versions of the package mockjs are vulnerable to Prototype Pollution via the Util.extend function due to missing check if the attribute resolves to the object prototype. By adding or modifying attributes of an object prototype, it is possible to create attributes that exist on every object, or replace critical attributes with malicious ones. This can be problematic if the software depends on existence or non-existence of certain attributes, or uses pre-defined attributes of object prototype (such as hasOwnProperty, toString or valueOf). User controlled inputs inside the extend() method of the Mock.Handler, Mock.Random, Mock.RE.Handler or Mock.Util, will allow an attacker to exploit this vulnerability. Workaround By using a denylist of dangerous attributes, this weakness can be eliminated. Add the following line in the Util.extend function: js js if (["__proto__", "constructor", "prototype"].includes(name)) continue js // src/mock/handler.js Util.extend = function extend() { var target = arguments[0] || {}, i = 1, length = arguments.length, options, name, src, copy, clone if (length === 1) { target = this i = 0 } for (; i < length; i++) { options = arguments[i] if (!options) continue for (name in options) { if (["__proto__", "constructor", "prototype"].includes(name)) continue src = target[name] copy = options[name] if (target === copy) continue if (copy === undefined) continue if (Util.isArray(copy) || Util.isObject(copy)) { if (Util.isArray(copy)) clone = src && Util.isArray(src) ? src : [] if (Util.isObject(copy)) clone = src && Util.isObject(src) ? src : {} target[name] = Util.extend(clone, copy) } else { target[name] = copy } } } return target }
From the CVE record by snyk, last updated August 2, 2024, 11:39 UTC.
Which versions are affected, and which fix it?
| Vendor | Product | Affected | Fixed or not affected from |
|---|---|---|---|
| mockjs | all versions |
As the CVE record by snyk states it, last updated August 2, 2024. Version ranges are the CNA's; a version the record calls not affected is usually the fix.
Which packages are affected, and in which version is each fixed?
| Ecosystem | Package | Affected | Fixed in | Advisory |
|---|---|---|---|---|
| npm | mockjs | <= 1.1.0 | none listed | GHSA-mh8j-9jvh-gjf6 |
GitHub Advisory Database, reviewed advisories (CC BY 4.0); advisory updated December 8, 2023. Summary: mockjs vulnerable to Prototype Pollution via the Util.extend function.
Which products and versions does the NVD list as affected?
| Vendor | Product | Versions | Type |
|---|---|---|---|
| mockjs | mock.js | through 1.1.0 | application |
NVD analysis (status Modified), last modified June 17, 2026, 05:42 UTC.
How severe is CVE-2023-26158?
| Score | Version | Vector | Source |
|---|---|---|---|
| High 8.2 | CVSS 3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H/E:P | snyk |
| High 8.2 | CVSS 3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H | NVD |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2023-26158 exploited in the wild?
- CISA KEV
- Not listed (catalog 2026.11.30)
- EPSS
- 0.81% probability of exploitation activity in the next 30 days, percentile 58.2 (FIRST EPSS, scores of December 3, 2026)
What kind of flaw is it?
- CWE-1321 Improperly Controlled Modification of Object Prototype Attributes
Where are the vendor advisories and references?
- https://security.snyk.io/vuln/SNYK-JS-MOCKJS-6051365
- https://github.com/nuysoft/Mock/blob/00ce04b92eb464e664a4438430903f2de96efb47/dist/mock.js%23L721-L755
Who found and reported it?
- Timothee Desurmont (finder)
As published in the CVE record; contact details are removed.
When was it published, and where is the official record?
- Reserved
- February 20, 2023
- Published
- December 8, 2023, 05:00 UTC
- CVE record updated
- August 2, 2024, 11:39 UTC by snyk
- NVD
- Modified, last modified June 17, 2026, 05:42 UTC
- Last checked
- CVE list November 19, 2026, 07:13 UTC; NVD November 19, 2026, 07:33 UTC; KEV December 3, 2026, 16:39 UTC; EPSS December 3, 2026
- Official record
- cve.org · NVD
Questions about CVE-2023-26158
Is CVE-2023-26158 exploited in the wild?
Not as far as CISA knows: it is not in the Known Exploited Vulnerabilities catalog, read December 3, 2026, 16:39 UTC. FIRST's EPSS gives it a 0.81% chance of exploitation activity in the next 30 days (scores of December 3, 2026).
Which versions of mockjs are affected by CVE-2023-26158?
mockjs through 1.1.0, per the GitHub advisory GHSA-mh8j-9jvh-gjf6. The tables above give every range the sources list.
Which version fixes CVE-2023-26158?
None of the sources (the CVE record, the NVD and GitHub's reviewed advisories) lists a fixed version yet. Check the vendor's advisory in the references.
How severe is CVE-2023-26158?
High (8.2, CVSS 3.1, from snyk). The severity table above shows each score with its source.
Where is the official record of CVE-2023-26158?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov. For a fix, the vendor's own advisory is the one to follow.