CVE-2021-25916: Prototype Pollution Vulnerability in patchmerge

patchmerge Updated 02 Oct 2025

Summary

13/10/2021
Yes i
Critical
9.8

CVE-2021-25916: Prototype pollution vulnerability in 'patchmerge'. Affects patchmerge versions >= 1.0.0, < 1.0.2. Fixed in 1.0.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

patchmerge is an npm package that provides functionality for merging and patching JavaScript objects. It is commonly used in web development projects to handle object manipulation and data merging tasks. The package is vulnerable to a prototype pollution vulnerability in versions 1.0.0 through 1.0.1. This vulnerability can be exploited by an attacker to cause a denial of service and potentially execute remote code.

Vulnerability Detail

The prototype pollution vulnerability in patchmerge arises from improper handling of user-supplied input. By manipulating the prototype of an object, an attacker can modify the behavior of the application and potentially execute arbitrary code. This can lead to a variety of security issues, including remote code execution and unauthorized access to sensitive data. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.

How To Fix

Latest published version: 1.0.2 as of 22 Oct 2026

npm install patchmerge@1.0.2

The newest release already contains this fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, a temporary workaround can be implemented by avoiding the use of untrusted user input when using the patchmerge package. It is important to thoroughly validate and sanitize any user-supplied data before passing it to the package's functions. Here is an example of how to sanitize user input in JavaScript:

function sanitizeInput(input) {
  if (typeof input === 'object' && input !== null) {
    return input;
  }
  return {};
}

Conclusion

The prototype pollution vulnerability in patchmerge can have severe consequences, including remote code execution and unauthorized data access. It is crucial to upgrade to the latest version of the package (1.0.2 or later) to mitigate this vulnerability. If immediate upgrading is not possible, developers should implement proper input validation and sanitization to prevent potential exploitation. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for patchmerge →

Share this vulnerability

FAQ

patchmerge is an npm package used for merging and patching JavaScript objects in web development projects.

Versions 1.0.0 through 1.0.1 of patchmerge are affected by this vulnerability.

Prototype pollution is a vulnerability that allows an attacker to modify the prototype of an object, leading to unexpected behavior and potential security issues.

This vulnerability can result in a denial of service, remote code execution, and unauthorized access to sensitive data.

To fix this vulnerability, upgrade to patchmerge version 1.0.2 or later.

How To Fix

Latest published version: 1.0.2 as of 22 Oct 2026

npm install patchmerge@1.0.2

The newest release already contains this fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback