================================================================================ legitbiz[research] // advisory ================================================================================ id: LB-2026-009 // json-artisan target: json-artisan <= 0.1.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 json-artisan version <= 0.1.3 allows an attacker who can influence a source object passed to artisan() to write arbitrary properties onto the global Object.prototype, affecting every object in the application. -------------------------------------------------------------------------------- [02] // root cause analysis (lib/json-artisan.js) -------------------------------------------------------------------------------- In lib/json-artisan.js, artisan() iterates `for (const key of Object.keys(source))` and assigns `target[key] = _extend(target[key], source[key])`, recursing via _extend when the value is an object, with no guard for dangerous keys. When `key === "__proto__"`, `target["__proto__"]` resolves to Object.prototype, so the recursion writes attacker-controlled keys onto the global prototype. -------------------------------------------------------------------------------- [03] // proof of concept -------------------------------------------------------------------------------- const artisan = require('json-artisan'); artisan({}, JSON.parse('{"__proto__":{"ja_pwned":"YES"}}')); console.log(({}).ja_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 assigning and recursing:  for (const key of Object.keys(source)) {  if (key === '__proto__' || key === 'constructor' || key === 'prototype') continue;  target[key] = _extend(target[key], source[key]);  } ================================================================================