VYPR
Moderate severityGHSA Advisory· Published Apr 7, 2020· Updated Aug 4, 2024

CVE-2020-7616

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.

PackageAffected versionsPatched versions
express-mock-middlewarenpm
<= 0.0.6

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

4

News mentions

0

No linked articles in our index yet.