@theecryptochad/merge-guard has Prototype Pollution in its deepMerge() functionGHSA-mhwj-73qx-jqxm
HIGHFix: TheeCryptoChad/merge-guard@25e4b4fGHSA-mhwj-73qx-jqxm is a high-severity (CVSS 7.5) vulnerability in @theecryptochad/merge-guard. A fix is available for @theecryptochad/merge-guard — see the affected versions and patch details below.
Real-World Exposure
@theecryptochad/merge-guardReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.
Description
Summary
@theecryptochad/merge-guard versions prior to 1.0.1 are vulnerable to Prototype Pollution via the deepMerge() function. An attacker who controls the source object can inject __proto__ keys that mutate Object.prototype, affecting all objects in the Node.js runtime.
Details
The deepMerge() function recursively merges two objects without sanitizing reserved property keys (__proto__, constructor, prototype). When a source object contains a __proto__ key, its value is assigned to target.__proto__, which JavaScript engines interpret as a write to Object.prototype.
Proof of Concept
const { deepMerge } = require('@theecryptochad/merge-guard');
const payload = JSON.parse('{"__proto__":{"isAdmin":true}}');
deepMerge({}, payload);
console.log({}.isAdmin); // true — Object.prototype is polluted
Impact
Any application using deepMerge() with untrusted input (e.g. user-supplied JSON from HTTP requests, WebSocket messages, or config files) is vulnerable. An attacker can inject arbitrary properties onto Object.prototype, enabling privilege escalation, application logic bypass, and property injection.
Remediation
Upgrade to @theecryptochad/merge-guard >= 1.0.1, which adds an explicit blocklist:
const BLOCKED = new Set(['__proto__', 'constructor', 'prototype']);
if (BLOCKED.has(key)) continue;
References
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @theecryptochad/merge-guard | all versions | 1.0.1npm install @theecryptochad/merge-guard@1.0.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @theecryptochad/merge-guard, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @theecryptochad/merge-guard to 1.0.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-mhwj-73qx-jqxm is resolved across your whole dependency graph.
Workarounds
Close the privilege gap rather than the entry point: audit which accounts, roles and service identities can reach the affected operation, drop the component to the least privilege it actually needs, and review file and directory permissions created by earlier installs — a default left in place is what makes this reachable.
Frequently Asked Questions
Is GHSA-mhwj-73qx-jqxm in your dependencies?
Find it across npm, including transitive dependencies.