The makerjs.extendObject function copies properties from source objects without proper validation, potentially exposing applications to security risks. The function lacks hasOwnProperty() checks and does not filter dangerous keys, allowing inherited properties and potentially malicious properties to be copied to target objects.
The extendObject function iterates over source object properties using a for...in loop without:
hasOwnProperty() to exclude inherited properties__proto__, constructor, prototype)const makerjs = require('makerjs');
const source = { __proto__: { name: 'Ravi', isAdmin: true } };
const target = { name: 'user' };
const result = makerjs.extendObject(target, source);
console.log(result.name); // Ravi
console.log(result.isAdmin); // true
Unexpected Behavior: Properties may appear on target objects but not be own properties, breaking hasOwnProperty() assumptions in security-sensitive code.
Security Bypass Risk: Code relying on hasOwnProperty() for validation could be bypassed.
Future Risk: Lack of dangerous key filtering (__proto__, constructor, prototype) exposes potential attack vectors.
{
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2026-01-29T15:18:33Z",
"nvd_published_at": "2026-01-28T22:15:56Z",
"severity": "MODERATE"
}