================================================================================ legitbiz[research] // advisory ================================================================================ id: LB-2026-007 // cloneextend target: cloneextend <= 0.0.3 (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 cloneextend version <= 0.0.3 allows an attacker who can influence an object passed to the extend() sink to write arbitrary properties onto the global Object.prototype, affecting every object in the application. -------------------------------------------------------------------------------- [02] // root cause analysis (index.js) -------------------------------------------------------------------------------- In index.js, the recursive extend() function iterates `for (key in b)` guarded only by `b.hasOwnProperty(key)`. A `__proto__` key from a JSON-parsed object is own and enumerable, so it passes the guard. When `key === "__proto__"` and `b[key]` is an object, the code recurses `extend({}, b[key], ...)` into `a["__proto__"]` (Object.prototype), writing attacker keys onto the global prototype. -------------------------------------------------------------------------------- [03] // proof of concept -------------------------------------------------------------------------------- const { extend } = require('cloneextend'); extend({}, JSON.parse('{"__proto__":{"ce_pwned":"YES"}}')); console.log(({}).ce_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 via  prototype property checks, and RCE in gadget chains across Node.js runtimes. -------------------------------------------------------------------------------- [05] // remediation -------------------------------------------------------------------------------- Denylist prototype keys before recursion:  for (key in b) {  if (b.hasOwnProperty(key)) {  if (key === '__proto__' || key === 'constructor' || key === 'prototype') continue;  if (typeof a[key] === 'undefined') { ... }  }  } ================================================================================