GHSA-2cp6-34r9-54xx

Suggest an improvement
Source
https://github.com/advisories/GHSA-2cp6-34r9-54xx
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/01/GHSA-2cp6-34r9-54xx/GHSA-2cp6-34r9-54xx.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-2cp6-34r9-54xx
Aliases
Published
2026-01-29T15:18:33Z
Modified
2026-02-03T03:03:44Z
Severity
  • 6.5 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N CVSS Calculator
Summary
Maker.js has Unsafe Property Copying in makerjs.extendObject
Details

Summary

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.

Details

The extendObject function iterates over source object properties using a for...in loop without:

  1. Checking hasOwnProperty() to exclude inherited properties
  2. Filtering dangerous keys (__proto__, constructor, prototype)
  3. Validating property sources

Affected Code

File: https://github.com/microsoft/maker.js/blob/98cffa82a372ff942194c925a12a311253587167/packages/maker.js/src/core/maker.ts#L232-L241

PoC

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

Impact

Security Implications

  1. Unexpected Behavior: Properties may appear on target objects but not be own properties, breaking hasOwnProperty() assumptions in security-sensitive code.

  2. Security Bypass Risk: Code relying on hasOwnProperty() for validation could be bypassed.

  3. Future Risk: Lack of dangerous key filtering (__proto__, constructor, prototype) exposes potential attack vectors.

Affected Use Cases

  • Extending objects from user input or external APIs
  • Merging options from untrusted sources
Database specific
{
    "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"
}
References

Affected packages

npm / makerjs

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
0.19.2

Database specific

last_known_affected_version_range
"<= 0.19.1"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/01/GHSA-2cp6-34r9-54xx/GHSA-2cp6-34r9-54xx.json"