================================================================================ legitbiz[research] // advisory ================================================================================ id: LB-2026-005 // smart-merge target: smart-merge <= 0.1.7 (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 smart-merge version <= 0.1.7 allows an attacker who can influence an object passed to quickMerge() to write arbitrary properties onto the global Object.prototype, affecting every object in the application. -------------------------------------------------------------------------------- [02] // root cause analysis (index.js) -------------------------------------------------------------------------------- In index.js, quickMerge(a, b) iterates `for (var i in b)` and directly assigns:  a[i] = quickMerge(a[i], b[i]) with zero property sanitization. For `i === '__proto__'`, `a['__proto__']` resolves to Object.prototype, allowing recursive writes to corrupt the global object prototype. -------------------------------------------------------------------------------- [03] // proof of concept -------------------------------------------------------------------------------- const merge = require('smart-merge'); merge({}, JSON.parse('{"__proto__":{"sm_pwned":"YES"}}')); console.log(({}).sm_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) * Process-wide prototype corruption enabling denial of service, privilege  escalation via logic bypass, and gadget chain execution. -------------------------------------------------------------------------------- [05] // remediation -------------------------------------------------------------------------------- Filter dangerous prototype keys before recursion:  const UNSAFE = new Set(['__proto__', 'constructor', 'prototype']);  for (var i in b) {  if (UNSAFE.has(i)) continue;  a[i] = quickMerge(a[i], b[i]);  } ================================================================================