CVE-2020-7616
Description
express-mock-middleware before 0.0.7 contains a prototype pollution vulnerability allowing an attacker to modify Object.prototype by placing crafted code in a new directory that the package exports.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
express-mock-middleware before 0.0.7 contains a prototype pollution vulnerability allowing an attacker to modify Object.prototype by placing crafted code in a new directory that the package exports.
Vulnerability
Overview
The express-mock-middleware package through version 0.0.6 is vulnerable to a prototype pollution attack. The exported functions of the package can be tricked into adding or modifying properties on Object.prototype. This occurs because the package's lib/index.js merges user-controlled object properties without proper filtering, as seen in the source code handling [3].
Exploitation
Scenario
Exploitation of this vulnerability requires the attacker to create a new directory containing malicious code, which will then be exported by express-mock-middleware. The attacker must have the ability to place files in a location that the package processes (e.g., by controlling a mock data directory). No authentication is required beyond the ability to create files on the server where the package is used. The attack vector is considered low risk due to the prerequisite of directory creation [1][2].
Impact
A successful exploit allows an attacker to inject properties into Object.prototype, which can affect all objects in the Node.js application. This can lead to unexpected application behavior, property injection, and in some cases, denial of service if critical properties are overwritten. The default configuration of the package does not protect against this type of pollution [1].
Mitigation
As of the advisory date, no patch was available. Users should upgrade to version 0.0.7 or later if a fix has been released. Workarounds include avoiding the use of dynamic imports from untrusted directories or applying input validation on the mock data paths. The vulnerability is not listed in CISA's Known Exploited Vulnerabilities catalog at the time of publication [1][2].
AI Insight generated on May 21, 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 |
|---|---|---|
express-mock-middlewarenpm | <= 0.0.6 | — |
Affected products
2- Range: <= 0.0.6
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4- github.com/advisories/GHSA-v39h-qm32-8gwqghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-7616ghsaADVISORY
- github.com/LingyuCoder/express-mock-middleware/blob/master/lib/index.jsghsax_refsource_MISCWEB
- snyk.io/vuln/SNYK-JS-EXPRESSMOCKMIDDLEWARE-564120ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.