# GHSA-mhwj-73qx-jqxm: @theecryptochad/merge-guard has Prototype Pollution in its deepMerge() function

> Prototype pollution in deepMerge allows attackers to inject properties into Object.prototype, leading to privilege escalation or logic bypass.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 11 May 2026

## What is GHSA-mhwj-73qx-jqxm?

GHSA-mhwj-73qx-jqxm is an unsafe deserialization vulnerability in @theecryptochad/merge-guard, published on 11 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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

```js
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:

```js
const BLOCKED = new Set(['__proto__', 'constructor', 'prototype']);
if (BLOCKED.has(key)) continue;
```

## References
- [CWE-1321: Improper Neutralization of Special Elements in Object Keys](https://cwe.mitre.org/data/definitions/1321.html)
- [OWASP: Prototype Pollution](https://owasp.org/www-community/attacks/Prototype_Pollution)
- [Fix commit](https://github.com/TheeCryptoChad/merge-guard/releases/tag/v1.0.1)

## Which versions are affected by GHSA-mhwj-73qx-jqxm?

2 open source packages ship an affected version, including @theecryptochad/merge-guard.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@theecryptochad/merge-guard` | npm | All versions | 1.0.1 |
| `@theecryptochad/merge-guard` | npm | All versions | 1.0.1 |

## How do I fix GHSA-mhwj-73qx-jqxm?

Upgrade @theecryptochad/merge-guard to 1.0.1 or later.

## Is GHSA-mhwj-73qx-jqxm being exploited?

There is no known exploitation of GHSA-mhwj-73qx-jqxm in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-mhwj-73qx-jqxm and fix it if it is affected.

What it is: GHSA-mhwj-73qx-jqxm is an unsafe deserialization vulnerability in @theecryptochad/merge-guard, published on 11 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-mhwj-73qx-jqxm in the wild and no public exploit code.

Affected packages and fixed versions:
- @theecryptochad/merge-guard (npm): affected all versions; fixed in 1.0.1
- @theecryptochad/merge-guard (npm): affected all versions; fixed in 1.0.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-mhwj-73qx-jqxm/ (Markdown: https://insights.sbomify.com/GHSA-mhwj-73qx-jqxm/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-mhwj-73qx-jqxm

---
From sbomify Insights: https://insights.sbomify.com/GHSA-mhwj-73qx-jqxm/
Summaries are generated and may contain mistakes; the official description above is the record.
