================================================================================ legitbiz[research] // advisory ================================================================================ id: LB-2026-008 // deepr target: deepr <= 1.2.2 (npm) type: Prototype Pollution (CWE-1321) severity: High (CVSS:3.1 7.3 - AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H) channel: GitHub Issues / Coordinated Disclosure date: 2026-11-27 status: submitted / vendor notified researcher: legitbiz[research] -------------------------------------------------------------------------------- [01] // summary -------------------------------------------------------------------------------- A prototype-pollution vulnerability in deepr version <= 1.2.2 allows an attacker who can influence an object passed to the merge() sink to write arbitrary properties onto the global Object.prototype, affecting every object in the application. -------------------------------------------------------------------------------- [02] // root cause analysis (src/deepr.js) -------------------------------------------------------------------------------- In src/deepr.js, mergeObject(prev, next, clone) iterates Object.keys(next) and assigns `state[key] = mergeObject(state[key] || {}, val, clone)` when the value is an object, with no guard for dangerous keys. When `key === "__proto__"`, `state["__proto__"]` resolves to Object.prototype, so the recursion writes attacker-controlled keys onto the global prototype. -------------------------------------------------------------------------------- [03] // proof of concept -------------------------------------------------------------------------------- const { merge } = require('deepr'); merge({}, JSON.parse('{"__proto__":{"deepr_pwned":"YES"}}')); console.log(({}).deepr_pwned); // "YES" -- Object.prototype is polluted -------------------------------------------------------------------------------- [04] // impact assessment -------------------------------------------------------------------------------- * CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H (Score: 7.3 High) * Global prototype pollution causing denial of service, authorization bypass,  and RCE in gadget chains. Effect is process-wide and persistent. -------------------------------------------------------------------------------- [05] // remediation -------------------------------------------------------------------------------- Denylist prototype keys before recursion:  Object.keys(next).forEach(key => {  if (key === '__proto__' || key === 'constructor' || key === 'prototype') return;  const val = next[key];  state[key] = mergeObject(state[key] || {}, val, clone);  }); ================================================================================